@onivoro/isomorphic-common 22.0.7 → 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} +41 -4
- 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/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/constants/regexes.constant.d.ts +0 -27
- package/dist/cjs/lib/constants/regexes.constant.js +0 -30
- 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/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/constants/regexes.constant.d.ts +0 -27
- package/dist/esm/lib/constants/regexes.constant.js +0 -30
- 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/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/constants/regexes.constant.d.ts +0 -27
- 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
|
@@ -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;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// https://github.com/lodash/lodash/blob/main/src/isSymbol.ts
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.isSymbol = isSymbol;
|
|
5
|
-
const get_tag_function_1 = require("./get-tag.function");
|
|
6
|
-
function isSymbol(value) {
|
|
7
|
-
const type = typeof value;
|
|
8
|
-
return (type === 'symbol' ||
|
|
9
|
-
(type === 'object' && value != null && (0, get_tag_function_1.getTag)(value) === '[object Symbol]'));
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isValidDate(dateString: string | Date): Date | undefined;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isValidDate = isValidDate;
|
|
4
|
-
function isValidDate(dateString) {
|
|
5
|
-
const date = new Date(dateString);
|
|
6
|
-
return (date instanceof Date && !isNaN(date.getTime())) ? date : undefined;
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function kebabCase(string: string): string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.kebabCase = kebabCase;
|
|
4
|
-
const snake_case_function_1 = require("./snake-case.function");
|
|
5
|
-
function kebabCase(string) {
|
|
6
|
-
return (0, snake_case_function_1.snakeCase)(string).replace(/_/g, '-');
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function mapEnumToArrayOfValues(enumeration: any): any;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapEnumToLookupArray = mapEnumToLookupArray;
|
|
4
|
-
function mapEnumToLookupArray(enumeration) {
|
|
5
|
-
return Object.entries(enumeration)
|
|
6
|
-
.map(([key, value]) => ({ value, display: key.replace(/_/g, ' ') }));
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapEnumToOptions = mapEnumToOptions;
|
|
4
|
-
function mapEnumToOptions(enumeration, includeBlank = true) {
|
|
5
|
-
const enumArray = Object.entries(enumeration).map(([key, value]) => ({ value, display: key.replace(/_/g, ' ') }));
|
|
6
|
-
return includeBlank
|
|
7
|
-
? [{ display: '', value: '' }, ...enumArray]
|
|
8
|
-
: enumArray;
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function money(rawValue: number | string): string | undefined;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.money = money;
|
|
4
|
-
const remove_alpha_chars_function_1 = require("./remove-alpha-chars.function");
|
|
5
|
-
function money(rawValue) {
|
|
6
|
-
if (!rawValue) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const scrubbed = (0, remove_alpha_chars_function_1.removeAlphaChars)(rawValue);
|
|
10
|
-
const amount = Number(scrubbed);
|
|
11
|
-
if (!amount && amount !== 0) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const formatter = new Intl.NumberFormat('en-US', {
|
|
15
|
-
style: 'currency',
|
|
16
|
-
currency: 'USD'
|
|
17
|
-
});
|
|
18
|
-
return formatter.format(Number(amount));
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function parseBool(asc: string | boolean | null | undefined): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function propertiesToArray(obj: Record<string, any>): any;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// credit https://stackoverflow.com/questions/15690706/recursively-looping-through-an-object-to-build-a-property-list/53620876#53620876
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.propertiesToArray = propertiesToArray;
|
|
5
|
-
function propertiesToArray(obj) {
|
|
6
|
-
const isObject = (val) => val && typeof val === 'object' && !Array.isArray(val);
|
|
7
|
-
const addDelimiter = (a, b) => a ? `${a}.${b}` : b;
|
|
8
|
-
const paths = (obj = {}, head = '') => {
|
|
9
|
-
return Object.entries(obj)
|
|
10
|
-
.reduce((product, [key, value]) => {
|
|
11
|
-
let fullPath = addDelimiter(head, key);
|
|
12
|
-
return isObject(value) ?
|
|
13
|
-
product.concat(paths(value, fullPath))
|
|
14
|
-
: product.concat(fullPath);
|
|
15
|
-
}, []);
|
|
16
|
-
};
|
|
17
|
-
return paths(obj);
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function removeAlphaChars(input?: string | number): string | undefined;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeAlphaChars = removeAlphaChars;
|
|
4
|
-
const regexes_constant_1 = require("../constants/regexes.constant");
|
|
5
|
-
function removeAlphaChars(input) {
|
|
6
|
-
if (!input) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
return input.toString().match(regexes_constant_1.decimalRegex)?.join?.('');
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function removeElementAtIndex<T>(array: T[], indexToRemove: number): T[];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeElementAtIndex = removeElementAtIndex;
|
|
4
|
-
function removeElementAtIndex(array, indexToRemove) {
|
|
5
|
-
const newArray = [];
|
|
6
|
-
(array || []).forEach((element, index) => {
|
|
7
|
-
if (index !== indexToRemove) {
|
|
8
|
-
newArray.push(element);
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
return newArray;
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function round(numberToRound: number, scalingFactor: number): number;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.round = round;
|
|
4
|
-
function round(numberToRound, scalingFactor) {
|
|
5
|
-
const scaledServingDose = numberToRound * scalingFactor;
|
|
6
|
-
return Math.round(scaledServingDose) / scalingFactor;
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function sanitizeFilename(filename: string): string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable no-control-regex */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.sanitizeFilename = sanitizeFilename;
|
|
5
|
-
const _ = '_';
|
|
6
|
-
const asciiReplacementRegX = /\/|\?|:|\\|{|\^|'|\}|%|`|]|>|\[|~|<|#|\||"|!|\*/g;
|
|
7
|
-
const unicodeReplacementRegX = /[^\u0000-\u007F]/g;
|
|
8
|
-
function sanitizeFilename(filename) {
|
|
9
|
-
return filename.replace(unicodeReplacementRegX, _).replace(asciiReplacementRegX, _).replace(/_+/g, _).trim();
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function sleep(milliseconds?: number): Promise<unknown>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts `string` to
|
|
3
|
-
* [snake case](https://en.wikipedia.org/wiki/Snake_case).
|
|
4
|
-
*
|
|
5
|
-
* @since 3.0.0
|
|
6
|
-
* @category String
|
|
7
|
-
* @param {string} [string=''] The string to convert.
|
|
8
|
-
* @returns {string} Returns the snake cased string.
|
|
9
|
-
* @see camelCase, lowerCase, kebabCase, startCase, upperCase, upperFirst
|
|
10
|
-
* @example
|
|
11
|
-
*
|
|
12
|
-
* snakeCase('Foo Bar')
|
|
13
|
-
* // => 'foo_bar'
|
|
14
|
-
*
|
|
15
|
-
* snakeCase('fooBar')
|
|
16
|
-
* // => 'foo_bar'
|
|
17
|
-
*
|
|
18
|
-
* snakeCase('--FOO-BAR--')
|
|
19
|
-
* // => 'foo_bar'
|
|
20
|
-
*
|
|
21
|
-
* snakeCase('foo2bar')
|
|
22
|
-
* // => 'foo_2_bar'
|
|
23
|
-
*/
|
|
24
|
-
export declare function snakeCase(string: string): string;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// source https://github.com/lodash/lodash/blob/master/snakeCase.js
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.snakeCase = snakeCase;
|
|
5
|
-
const words_function_1 = require("./words.function");
|
|
6
|
-
/**
|
|
7
|
-
* Converts `string` to
|
|
8
|
-
* [snake case](https://en.wikipedia.org/wiki/Snake_case).
|
|
9
|
-
*
|
|
10
|
-
* @since 3.0.0
|
|
11
|
-
* @category String
|
|
12
|
-
* @param {string} [string=''] The string to convert.
|
|
13
|
-
* @returns {string} Returns the snake cased string.
|
|
14
|
-
* @see camelCase, lowerCase, kebabCase, startCase, upperCase, upperFirst
|
|
15
|
-
* @example
|
|
16
|
-
*
|
|
17
|
-
* snakeCase('Foo Bar')
|
|
18
|
-
* // => 'foo_bar'
|
|
19
|
-
*
|
|
20
|
-
* snakeCase('fooBar')
|
|
21
|
-
* // => 'foo_bar'
|
|
22
|
-
*
|
|
23
|
-
* snakeCase('--FOO-BAR--')
|
|
24
|
-
* // => 'foo_bar'
|
|
25
|
-
*
|
|
26
|
-
* snakeCase('foo2bar')
|
|
27
|
-
* // => 'foo_2_bar'
|
|
28
|
-
*/
|
|
29
|
-
function snakeCase(string) {
|
|
30
|
-
return ((0, words_function_1.words)(string.replace(/['\u2019]/g, '')).reduce((result, word, index) => (result + (index ? '_' : '') + word.toLowerCase()), ''));
|
|
31
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function subtractOffset(input: string | Date | undefined | null): Date | undefined;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.subtractOffset = subtractOffset;
|
|
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 subtractOffset(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 +0,0 @@
|
|
|
1
|
-
export declare function toBooleanString(val?: boolean): "true" | "false";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function toCalendarDate(input: string | Date | undefined | null): string | undefined;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toCalendarDate = toCalendarDate;
|
|
4
|
-
const subtract_offset_function_1 = require("./subtract-offset.function");
|
|
5
|
-
function toCalendarDate(input) {
|
|
6
|
-
const parsed = (0, subtract_offset_function_1.subtractOffset)(input);
|
|
7
|
-
if (!parsed) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
return parsed?.toISOString().split('T')[0];
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function toCsvString(val?: string[]): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function toDecimalBase(n: string | number, base?: number): number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function toDollarsAndCents(input: string | number): string;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toDollarsAndCents = toDollarsAndCents;
|
|
4
|
-
const remove_alpha_chars_function_1 = require("./remove-alpha-chars.function");
|
|
5
|
-
const to_words_function_1 = require("./to-words.function");
|
|
6
|
-
function toDollarsAndCents(input) {
|
|
7
|
-
const number = (0, remove_alpha_chars_function_1.removeAlphaChars)(input);
|
|
8
|
-
const num = Number(number);
|
|
9
|
-
const decimal = (Math.round((num % 1) * 100)) / 100;
|
|
10
|
-
const int = num - decimal;
|
|
11
|
-
const dollars = `${(0, to_words_function_1.toWords)(int)} dollars`;
|
|
12
|
-
if (!decimal) {
|
|
13
|
-
return dollars;
|
|
14
|
-
}
|
|
15
|
-
return `${dollars} and ${(0, to_words_function_1.toWords)(decimal * 100)} cents`;
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function toString(value: any): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function toUniqueArray<TElement>(elements: TElement[]): TElement[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function toWords(input: number | string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tryJsonParse<T>(parseable: string | null | undefined): T | null;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tryJsonParse = tryJsonParse;
|
|
4
|
-
function tryJsonParse(parseable) {
|
|
5
|
-
if (typeof parseable === 'undefined') {
|
|
6
|
-
return null;
|
|
7
|
-
}
|
|
8
|
-
try {
|
|
9
|
-
return JSON.parse(parseable);
|
|
10
|
-
}
|
|
11
|
-
catch (_e) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tryJsonStringify<T>(object: T | null | undefined, fmtr?: any, spaces?: number): string | null;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tryJsonStringify = tryJsonStringify;
|
|
4
|
-
function tryJsonStringify(object, fmtr, spaces) {
|
|
5
|
-
if (typeof object === 'undefined') {
|
|
6
|
-
return null;
|
|
7
|
-
}
|
|
8
|
-
try {
|
|
9
|
-
return JSON.stringify(object, fmtr, spaces);
|
|
10
|
-
}
|
|
11
|
-
catch (_e) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tryParseDate(input: string | Date | undefined | null): Date | undefined;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tryParseDate = tryParseDate;
|
|
4
|
-
function tryParseDate(input) {
|
|
5
|
-
if (!input) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
if (input instanceof Date) {
|
|
9
|
-
return input;
|
|
10
|
-
}
|
|
11
|
-
const date = new Date(input);
|
|
12
|
-
if (date == 'Invalid Date') {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
return date;
|
|
16
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// source https://github.com/lodash/lodash/blob/master/.internal/unicodeWords.js
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.unicodeWords = unicodeWords;
|
|
5
|
-
/** Used to compose unicode character classes. */
|
|
6
|
-
const rsAstralRange = '\\ud800-\\udfff';
|
|
7
|
-
const rsComboMarksRange = '\\u0300-\\u036f';
|
|
8
|
-
const reComboHalfMarksRange = '\\ufe20-\\ufe2f';
|
|
9
|
-
const rsComboSymbolsRange = '\\u20d0-\\u20ff';
|
|
10
|
-
const rsComboMarksExtendedRange = '\\u1ab0-\\u1aff';
|
|
11
|
-
const rsComboMarksSupplementRange = '\\u1dc0-\\u1dff';
|
|
12
|
-
const rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange + rsComboMarksExtendedRange + rsComboMarksSupplementRange;
|
|
13
|
-
const rsDingbatRange = '\\u2700-\\u27bf';
|
|
14
|
-
const rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff';
|
|
15
|
-
const rsMathOpRange = '\\xac\\xb1\\xd7\\xf7';
|
|
16
|
-
const rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf';
|
|
17
|
-
const rsPunctuationRange = '\\u2000-\\u206f';
|
|
18
|
-
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';
|
|
19
|
-
const rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde';
|
|
20
|
-
const rsVarRange = '\\ufe0e\\ufe0f';
|
|
21
|
-
const rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
22
|
-
/** Used to compose unicode capture groups. */
|
|
23
|
-
const rsApos = "['\u2019]";
|
|
24
|
-
const rsBreak = `[${rsBreakRange}]`;
|
|
25
|
-
const rsCombo = `[${rsComboRange}]`;
|
|
26
|
-
const rsDigit = '\\d';
|
|
27
|
-
const rsDingbat = `[${rsDingbatRange}]`;
|
|
28
|
-
const rsLower = `[${rsLowerRange}]`;
|
|
29
|
-
const rsMisc = `[^${rsAstralRange}${rsBreakRange + rsDigit + rsDingbatRange + rsLowerRange + rsUpperRange}]`;
|
|
30
|
-
const rsFitz = '\\ud83c[\\udffb-\\udfff]';
|
|
31
|
-
const rsModifier = `(?:${rsCombo}|${rsFitz})`;
|
|
32
|
-
const rsNonAstral = `[^${rsAstralRange}]`;
|
|
33
|
-
const rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}';
|
|
34
|
-
const rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]';
|
|
35
|
-
const rsUpper = `[${rsUpperRange}]`;
|
|
36
|
-
const rsZWJ = '\\u200d';
|
|
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
|
-
const reUnicodeWords = RegExp([
|
|
50
|
-
`${rsUpper}?${rsLower}+${rsOptContrLower}(?=${[rsBreak, rsUpper, '$'].join('|')})`,
|
|
51
|
-
`${rsMiscUpper}+${rsOptContrUpper}(?=${[rsBreak, rsUpper + rsMiscLower, '$'].join('|')})`,
|
|
52
|
-
`${rsUpper}?${rsMiscLower}+${rsOptContrLower}`,
|
|
53
|
-
`${rsUpper}+${rsOptContrUpper}`,
|
|
54
|
-
rsOrdUpper,
|
|
55
|
-
rsOrdLower,
|
|
56
|
-
`${rsDigit}+`,
|
|
57
|
-
rsEmoji
|
|
58
|
-
].join('|'), 'g');
|
|
59
|
-
/**
|
|
60
|
-
* Splits a Unicode `string` into an array of its words.
|
|
61
|
-
*
|
|
62
|
-
* @private
|
|
63
|
-
* @param {string} The string to inspect.
|
|
64
|
-
* @returns {Array} Returns the words of `string`.
|
|
65
|
-
*/
|
|
66
|
-
function unicodeWords(string) {
|
|
67
|
-
return string.match(reUnicodeWords);
|
|
68
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function upperFirst(string: string): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.upperFirst = upperFirst;
|
|
4
|
-
function upperFirst(string) {
|
|
5
|
-
if (!string) {
|
|
6
|
-
return string;
|
|
7
|
-
}
|
|
8
|
-
return string
|
|
9
|
-
.split('')
|
|
10
|
-
.map((curr, i) => curr[!i ? 'toUpperCase' : 'toLowerCase']())
|
|
11
|
-
.join('');
|
|
12
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Splits `string` into an array of its words.
|
|
3
|
-
*
|
|
4
|
-
* @since 3.0.0
|
|
5
|
-
* @category String
|
|
6
|
-
* @param {string} [string=''] The string to inspect.
|
|
7
|
-
* @param {RegExp|string} [pattern] The pattern to match words.
|
|
8
|
-
* @returns {Array} Returns the words of `string`.
|
|
9
|
-
* @example
|
|
10
|
-
*
|
|
11
|
-
* words('fred, barney, & pebbles')
|
|
12
|
-
* // => ['fred', 'barney', 'pebbles']
|
|
13
|
-
*
|
|
14
|
-
* words('fred, barney, & pebbles', /[^, ]+/g)
|
|
15
|
-
* // => ['fred', 'barney', '&', 'pebbles']
|
|
16
|
-
*/
|
|
17
|
-
export declare function words(string: string, pattern?: RegExp): [] | RegExpMatchArray;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// source https://github.com/lodash/lodash/blob/master/words.js
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.words = words;
|
|
5
|
-
const unicode_words_const_1 = require("./unicode-words.const");
|
|
6
|
-
const hasUnicodeWord = RegExp.prototype.test.bind(/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/);
|
|
7
|
-
/** Used to match words composed of alphanumeric characters. */
|
|
8
|
-
const reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
9
|
-
function asciiWords(string) {
|
|
10
|
-
return string.match(reAsciiWord);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Splits `string` into an array of its words.
|
|
14
|
-
*
|
|
15
|
-
* @since 3.0.0
|
|
16
|
-
* @category String
|
|
17
|
-
* @param {string} [string=''] The string to inspect.
|
|
18
|
-
* @param {RegExp|string} [pattern] The pattern to match words.
|
|
19
|
-
* @returns {Array} Returns the words of `string`.
|
|
20
|
-
* @example
|
|
21
|
-
*
|
|
22
|
-
* words('fred, barney, & pebbles')
|
|
23
|
-
* // => ['fred', 'barney', 'pebbles']
|
|
24
|
-
*
|
|
25
|
-
* words('fred, barney, & pebbles', /[^, ]+/g)
|
|
26
|
-
* // => ['fred', 'barney', '&', 'pebbles']
|
|
27
|
-
*/
|
|
28
|
-
function words(string, pattern) {
|
|
29
|
-
if (pattern === undefined) {
|
|
30
|
-
const result = hasUnicodeWord(string) ? (0, unicode_words_const_1.unicodeWords)(string) : asciiWords(string);
|
|
31
|
-
return result || [];
|
|
32
|
-
}
|
|
33
|
-
return string.match(pattern) || [];
|
|
34
|
-
}
|