@bgord/tools 1.4.0 → 1.4.1
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/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/tests/age-years.vo.test.d.ts +0 -1
- package/dist/tests/age-years.vo.test.js +0 -24
- package/dist/tests/age.vo.test.d.ts +0 -1
- package/dist/tests/age.vo.test.js +0 -106
- package/dist/tests/api-key.vo.test.d.ts +0 -1
- package/dist/tests/api-key.vo.test.js +0 -24
- package/dist/tests/basename.vo.test.d.ts +0 -1
- package/dist/tests/basename.vo.test.js +0 -53
- package/dist/tests/batch.test.d.ts +0 -1
- package/dist/tests/batch.test.js +0 -24
- package/dist/tests/date-calculator.service.test.d.ts +0 -1
- package/dist/tests/date-calculator.service.test.js +0 -32
- package/dist/tests/date-formatter.service.test.d.ts +0 -1
- package/dist/tests/date-formatter.service.test.js +0 -22
- package/dist/tests/date-range.vo.test.d.ts +0 -1
- package/dist/tests/date-range.vo.test.js +0 -49
- package/dist/tests/day-iso-id.vo.test.d.ts +0 -1
- package/dist/tests/day-iso-id.vo.test.js +0 -36
- package/dist/tests/day.vo.test.d.ts +0 -1
- package/dist/tests/day.vo.test.js +0 -68
- package/dist/tests/directory-path-absolute.vo.test.d.ts +0 -1
- package/dist/tests/directory-path-absolute.vo.test.js +0 -47
- package/dist/tests/directory-path-relative.vo.test.d.ts +0 -1
- package/dist/tests/directory-path-relative.vo.test.js +0 -44
- package/dist/tests/distance-value.vo.test.d.ts +0 -1
- package/dist/tests/distance-value.vo.test.js +0 -21
- package/dist/tests/distance.vo.test.d.ts +0 -1
- package/dist/tests/distance.vo.test.js +0 -74
- package/dist/tests/division-factor.vo.test.d.ts +0 -1
- package/dist/tests/division-factor.vo.test.js +0 -21
- package/dist/tests/dll.service.test.d.ts +0 -1
- package/dist/tests/dll.service.test.js +0 -381
- package/dist/tests/duration-ms.vo.test.d.ts +0 -1
- package/dist/tests/duration-ms.vo.test.js +0 -18
- package/dist/tests/duration.service.test.d.ts +0 -1
- package/dist/tests/duration.service.test.js +0 -126
- package/dist/tests/email-mask.service.test.d.ts +0 -1
- package/dist/tests/email-mask.service.test.js +0 -15
- package/dist/tests/email.vo.test.d.ts +0 -1
- package/dist/tests/email.vo.test.js +0 -17
- package/dist/tests/etags.vo.test.d.ts +0 -1
- package/dist/tests/etags.vo.test.js +0 -54
- package/dist/tests/extension.vo.test.d.ts +0 -1
- package/dist/tests/extension.vo.test.js +0 -51
- package/dist/tests/feature-flag-value.vo.test.d.ts +0 -1
- package/dist/tests/feature-flag-value.vo.test.js +0 -12
- package/dist/tests/feature-flag.vo.test.d.ts +0 -1
- package/dist/tests/feature-flag.vo.test.js +0 -13
- package/dist/tests/file-path-absolute-schema.vo.test.d.ts +0 -1
- package/dist/tests/file-path-absolute-schema.vo.test.js +0 -53
- package/dist/tests/file-path-relative-schema.vo.test.d.ts +0 -1
- package/dist/tests/file-path-relative-schema.vo.test.js +0 -52
- package/dist/tests/file-path.vo.test.d.ts +0 -1
- package/dist/tests/file-path.vo.test.js +0 -74
- package/dist/tests/filename-affix.vo.test.d.ts +0 -1
- package/dist/tests/filename-affix.vo.test.js +0 -30
- package/dist/tests/filename-from-string.vo.test.d.ts +0 -1
- package/dist/tests/filename-from-string.vo.test.js +0 -37
- package/dist/tests/filename.vo.test.d.ts +0 -1
- package/dist/tests/filename.vo.test.js +0 -93
- package/dist/tests/height-milimiters.vo.test.d.ts +0 -1
- package/dist/tests/height-milimiters.vo.test.js +0 -21
- package/dist/tests/height.vo.test.d.ts +0 -1
- package/dist/tests/height.vo.test.js +0 -64
- package/dist/tests/hour-value.vo.test.d.ts +0 -1
- package/dist/tests/hour-value.vo.test.js +0 -24
- package/dist/tests/hour.vo.test.d.ts +0 -1
- package/dist/tests/hour.vo.test.js +0 -64
- package/dist/tests/iban-mask.service.test.d.ts +0 -1
- package/dist/tests/iban-mask.service.test.js +0 -13
- package/dist/tests/iban-schema.vo.test.d.ts +0 -1
- package/dist/tests/iban-schema.vo.test.js +0 -43
- package/dist/tests/iban.vo.test.d.ts +0 -1
- package/dist/tests/iban.vo.test.js +0 -46
- package/dist/tests/image.vo.test.d.ts +0 -1
- package/dist/tests/image.vo.test.js +0 -41
- package/dist/tests/integer-non-negative.vo.test.d.ts +0 -1
- package/dist/tests/integer-non-negative.vo.test.js +0 -22
- package/dist/tests/integer-positive.vo.test.d.ts +0 -1
- package/dist/tests/integer-positive.vo.test.js +0 -21
- package/dist/tests/integer.vo.test.d.ts +0 -1
- package/dist/tests/integer.vo.test.js +0 -21
- package/dist/tests/language.vo.test.d.ts +0 -1
- package/dist/tests/language.vo.test.js +0 -28
- package/dist/tests/linear-regression.service.test.d.ts +0 -1
- package/dist/tests/linear-regression.service.test.js +0 -111
- package/dist/tests/mean.service.test.d.ts +0 -1
- package/dist/tests/mean.service.test.js +0 -23
- package/dist/tests/mime-registry-entry.vo.test.d.ts +0 -1
- package/dist/tests/mime-registry-entry.vo.test.js +0 -15
- package/dist/tests/mime-registry.service.test.d.ts +0 -1
- package/dist/tests/mime-registry.service.test.js +0 -45
- package/dist/tests/mime-value.vo.test.d.ts +0 -1
- package/dist/tests/mime-value.vo.test.js +0 -49
- package/dist/tests/mime.vo.test.d.ts +0 -1
- package/dist/tests/mime.vo.test.js +0 -53
- package/dist/tests/mimes.test.d.ts +0 -1
- package/dist/tests/mimes.test.js +0 -28
- package/dist/tests/min-max-scaler.service.test.d.ts +0 -1
- package/dist/tests/min-max-scaler.service.test.js +0 -116
- package/dist/tests/minute-value.vo.test.d.ts +0 -1
- package/dist/tests/minute-value.vo.test.js +0 -24
- package/dist/tests/minute.vo.test.d.ts +0 -1
- package/dist/tests/minute.vo.test.js +0 -64
- package/dist/tests/mocks.d.ts +0 -6
- package/dist/tests/mocks.js +0 -7
- package/dist/tests/money-amount.vo.test.d.ts +0 -1
- package/dist/tests/money-amount.vo.test.js +0 -21
- package/dist/tests/money.vo.test.d.ts +0 -1
- package/dist/tests/money.vo.test.js +0 -90
- package/dist/tests/month-iso-id.vo.test.d.ts +0 -1
- package/dist/tests/month-iso-id.vo.test.js +0 -36
- package/dist/tests/month.vo.test.d.ts +0 -1
- package/dist/tests/month.vo.test.js +0 -65
- package/dist/tests/multiplication-factor.vo.test.d.ts +0 -1
- package/dist/tests/multiplication-factor.vo.test.js +0 -19
- package/dist/tests/noop.test.d.ts +0 -1
- package/dist/tests/noop.test.js +0 -12
- package/dist/tests/object-key.vo.test.d.ts +0 -1
- package/dist/tests/object-key.vo.test.js +0 -56
- package/dist/tests/outlier-detector.service.test.d.ts +0 -1
- package/dist/tests/outlier-detector.service.test.js +0 -35
- package/dist/tests/package-version-schema.vo.test.d.ts +0 -1
- package/dist/tests/package-version-schema.vo.test.js +0 -32
- package/dist/tests/package-version.vo.test.d.ts +0 -1
- package/dist/tests/package-version.vo.test.js +0 -138
- package/dist/tests/pagination-page.vo.test.d.ts +0 -1
- package/dist/tests/pagination-page.vo.test.js +0 -26
- package/dist/tests/pagination-skip.vo.test.d.ts +0 -1
- package/dist/tests/pagination-skip.vo.test.js +0 -23
- package/dist/tests/pagination-take.vo.test.d.ts +0 -1
- package/dist/tests/pagination-take.vo.test.js +0 -25
- package/dist/tests/pagination.service.test.d.ts +0 -1
- package/dist/tests/pagination.service.test.js +0 -92
- package/dist/tests/percentage.service.test.d.ts +0 -1
- package/dist/tests/percentage.service.test.js +0 -16
- package/dist/tests/population-standard-deviation.service.test.d.ts +0 -1
- package/dist/tests/population-standard-deviation.service.test.js +0 -20
- package/dist/tests/quarter-iso-id.vo.test.d.ts +0 -1
- package/dist/tests/quarter-iso-id.vo.test.js +0 -30
- package/dist/tests/quarter.vo.test.d.ts +0 -1
- package/dist/tests/quarter.vo.test.js +0 -54
- package/dist/tests/random.service.test.d.ts +0 -1
- package/dist/tests/random.service.test.js +0 -93
- package/dist/tests/rate-limiter.service.test.d.ts +0 -1
- package/dist/tests/rate-limiter.service.test.js +0 -39
- package/dist/tests/relative-date.vo.test.d.ts +0 -1
- package/dist/tests/relative-date.vo.test.js +0 -22
- package/dist/tests/reordering-item-position-value.vo.test.d.ts +0 -1
- package/dist/tests/reordering-item-position-value.vo.test.js +0 -21
- package/dist/tests/reordering.service.test.d.ts +0 -1
- package/dist/tests/reordering.service.test.js +0 -76
- package/dist/tests/repeat.test.d.ts +0 -1
- package/dist/tests/repeat.test.js +0 -8
- package/dist/tests/revision-value.vo.test.d.ts +0 -1
- package/dist/tests/revision-value.vo.test.js +0 -21
- package/dist/tests/revision.vo.test.d.ts +0 -1
- package/dist/tests/revision.vo.test.js +0 -52
- package/dist/tests/rounding-decimal.strategy.test.d.ts +0 -1
- package/dist/tests/rounding-decimal.strategy.test.js +0 -17
- package/dist/tests/rounding-down.strategy.test.d.ts +0 -1
- package/dist/tests/rounding-down.strategy.test.js +0 -9
- package/dist/tests/rounding-to-nearest.strategy.test.d.ts +0 -1
- package/dist/tests/rounding-to-nearest.strategy.test.js +0 -9
- package/dist/tests/rounding-up.strategy.test.d.ts +0 -1
- package/dist/tests/rounding-up.strategy.test.js +0 -9
- package/dist/tests/size-bytes.vo.test.d.ts +0 -1
- package/dist/tests/size-bytes.vo.test.js +0 -21
- package/dist/tests/size.vo.test.d.ts +0 -1
- package/dist/tests/size.vo.test.js +0 -93
- package/dist/tests/slug.service.test.d.ts +0 -1
- package/dist/tests/slug.service.test.js +0 -45
- package/dist/tests/sum.service.test.d.ts +0 -1
- package/dist/tests/sum.service.test.js +0 -22
- package/dist/tests/thousands-separator.service.test.d.ts +0 -1
- package/dist/tests/thousands-separator.service.test.js +0 -27
- package/dist/tests/time-zone-offset-value.test.d.ts +0 -1
- package/dist/tests/time-zone-offset-value.test.js +0 -27
- package/dist/tests/timestamp-value.vo.test.d.ts +0 -1
- package/dist/tests/timestamp-value.vo.test.js +0 -21
- package/dist/tests/timestamp.vo.test.d.ts +0 -1
- package/dist/tests/timestamp.vo.test.js +0 -73
- package/dist/tests/timezone.vo.test.d.ts +0 -1
- package/dist/tests/timezone.vo.test.js +0 -29
- package/dist/tests/url-with-slash.vo.test.d.ts +0 -1
- package/dist/tests/url-with-slash.vo.test.js +0 -24
- package/dist/tests/url-without-slash.vo.test.d.ts +0 -1
- package/dist/tests/url-without-slash.vo.test.js +0 -25
- package/dist/tests/visually-unambiguous-characters-generator.service.test.d.ts +0 -1
- package/dist/tests/visually-unambiguous-characters-generator.service.test.js +0 -89
- package/dist/tests/week-iso-id.vo.test.d.ts +0 -1
- package/dist/tests/week-iso-id.vo.test.js +0 -37
- package/dist/tests/week.vo.test.d.ts +0 -1
- package/dist/tests/week.vo.test.js +0 -64
- package/dist/tests/weekday-iso-id.vo.test.d.ts +0 -1
- package/dist/tests/weekday-iso-id.vo.test.js +0 -24
- package/dist/tests/weekday.vo.test.d.ts +0 -1
- package/dist/tests/weekday.vo.test.js +0 -51
- package/dist/tests/weight-grams.vo.test.d.ts +0 -1
- package/dist/tests/weight-grams.vo.test.js +0 -21
- package/dist/tests/weight.vo.test.d.ts +0 -1
- package/dist/tests/weight.vo.test.js +0 -66
- package/dist/tests/year-iso-id.vo.test.d.ts +0 -1
- package/dist/tests/year-iso-id.vo.test.js +0 -23
- package/dist/tests/year.vo.test.d.ts +0 -1
- package/dist/tests/year.vo.test.js +0 -79
- package/dist/tests/z-score.service.test.d.ts +0 -1
- package/dist/tests/z-score.service.test.js +0 -26
- /package/dist/{src/age-years.vo.d.ts → age-years.vo.d.ts} +0 -0
- /package/dist/{src/age-years.vo.js → age-years.vo.js} +0 -0
- /package/dist/{src/age.vo.d.ts → age.vo.d.ts} +0 -0
- /package/dist/{src/age.vo.js → age.vo.js} +0 -0
- /package/dist/{src/api-key.vo.d.ts → api-key.vo.d.ts} +0 -0
- /package/dist/{src/api-key.vo.js → api-key.vo.js} +0 -0
- /package/dist/{src/basename.vo.d.ts → basename.vo.d.ts} +0 -0
- /package/dist/{src/basename.vo.js → basename.vo.js} +0 -0
- /package/dist/{src/batch.d.ts → batch.d.ts} +0 -0
- /package/dist/{src/batch.js → batch.js} +0 -0
- /package/dist/{src/date-calculator.service.d.ts → date-calculator.service.d.ts} +0 -0
- /package/dist/{src/date-calculator.service.js → date-calculator.service.js} +0 -0
- /package/dist/{src/date-formatter.service.d.ts → date-formatter.service.d.ts} +0 -0
- /package/dist/{src/date-formatter.service.js → date-formatter.service.js} +0 -0
- /package/dist/{src/date-range.vo.d.ts → date-range.vo.d.ts} +0 -0
- /package/dist/{src/date-range.vo.js → date-range.vo.js} +0 -0
- /package/dist/{src/day-iso-id.vo.d.ts → day-iso-id.vo.d.ts} +0 -0
- /package/dist/{src/day-iso-id.vo.js → day-iso-id.vo.js} +0 -0
- /package/dist/{src/day.vo.d.ts → day.vo.d.ts} +0 -0
- /package/dist/{src/day.vo.js → day.vo.js} +0 -0
- /package/dist/{src/directory-path-absolute.vo.d.ts → directory-path-absolute.vo.d.ts} +0 -0
- /package/dist/{src/directory-path-absolute.vo.js → directory-path-absolute.vo.js} +0 -0
- /package/dist/{src/directory-path-relative.vo.d.ts → directory-path-relative.vo.d.ts} +0 -0
- /package/dist/{src/directory-path-relative.vo.js → directory-path-relative.vo.js} +0 -0
- /package/dist/{src/distance-value.vo.d.ts → distance-value.vo.d.ts} +0 -0
- /package/dist/{src/distance-value.vo.js → distance-value.vo.js} +0 -0
- /package/dist/{src/distance.vo.d.ts → distance.vo.d.ts} +0 -0
- /package/dist/{src/distance.vo.js → distance.vo.js} +0 -0
- /package/dist/{src/division-factor.vo.d.ts → division-factor.vo.d.ts} +0 -0
- /package/dist/{src/division-factor.vo.js → division-factor.vo.js} +0 -0
- /package/dist/{src/dll.service.d.ts → dll.service.d.ts} +0 -0
- /package/dist/{src/dll.service.js → dll.service.js} +0 -0
- /package/dist/{src/duration-ms.vo.d.ts → duration-ms.vo.d.ts} +0 -0
- /package/dist/{src/duration-ms.vo.js → duration-ms.vo.js} +0 -0
- /package/dist/{src/duration.service.d.ts → duration.service.d.ts} +0 -0
- /package/dist/{src/duration.service.js → duration.service.js} +0 -0
- /package/dist/{src/email-mask.service.d.ts → email-mask.service.d.ts} +0 -0
- /package/dist/{src/email-mask.service.js → email-mask.service.js} +0 -0
- /package/dist/{src/email.vo.d.ts → email.vo.d.ts} +0 -0
- /package/dist/{src/email.vo.js → email.vo.js} +0 -0
- /package/dist/{src/etags.vo.d.ts → etags.vo.d.ts} +0 -0
- /package/dist/{src/etags.vo.js → etags.vo.js} +0 -0
- /package/dist/{src/extension.vo.d.ts → extension.vo.d.ts} +0 -0
- /package/dist/{src/extension.vo.js → extension.vo.js} +0 -0
- /package/dist/{src/feature-flag-value.vo.d.ts → feature-flag-value.vo.d.ts} +0 -0
- /package/dist/{src/feature-flag-value.vo.js → feature-flag-value.vo.js} +0 -0
- /package/dist/{src/feature-flag.vo.d.ts → feature-flag.vo.d.ts} +0 -0
- /package/dist/{src/feature-flag.vo.js → feature-flag.vo.js} +0 -0
- /package/dist/{src/file-path-absolute-schema.vo.d.ts → file-path-absolute-schema.vo.d.ts} +0 -0
- /package/dist/{src/file-path-absolute-schema.vo.js → file-path-absolute-schema.vo.js} +0 -0
- /package/dist/{src/file-path-relative-schema.vo.d.ts → file-path-relative-schema.vo.d.ts} +0 -0
- /package/dist/{src/file-path-relative-schema.vo.js → file-path-relative-schema.vo.js} +0 -0
- /package/dist/{src/file-path.vo.d.ts → file-path.vo.d.ts} +0 -0
- /package/dist/{src/file-path.vo.js → file-path.vo.js} +0 -0
- /package/dist/{src/filename-affix.vo.d.ts → filename-affix.vo.d.ts} +0 -0
- /package/dist/{src/filename-affix.vo.js → filename-affix.vo.js} +0 -0
- /package/dist/{src/filename-from-string.vo.d.ts → filename-from-string.vo.d.ts} +0 -0
- /package/dist/{src/filename-from-string.vo.js → filename-from-string.vo.js} +0 -0
- /package/dist/{src/filename.vo.d.ts → filename.vo.d.ts} +0 -0
- /package/dist/{src/filename.vo.js → filename.vo.js} +0 -0
- /package/dist/{src/height-milimiters.vo.d.ts → height-milimiters.vo.d.ts} +0 -0
- /package/dist/{src/height-milimiters.vo.js → height-milimiters.vo.js} +0 -0
- /package/dist/{src/height.vo.d.ts → height.vo.d.ts} +0 -0
- /package/dist/{src/height.vo.js → height.vo.js} +0 -0
- /package/dist/{src/hour-value.vo.d.ts → hour-value.vo.d.ts} +0 -0
- /package/dist/{src/hour-value.vo.js → hour-value.vo.js} +0 -0
- /package/dist/{src/hour.vo.d.ts → hour.vo.d.ts} +0 -0
- /package/dist/{src/hour.vo.js → hour.vo.js} +0 -0
- /package/dist/{src/iban-mask.service.d.ts → iban-mask.service.d.ts} +0 -0
- /package/dist/{src/iban-mask.service.js → iban-mask.service.js} +0 -0
- /package/dist/{src/iban-schema.vo.d.ts → iban-schema.vo.d.ts} +0 -0
- /package/dist/{src/iban-schema.vo.js → iban-schema.vo.js} +0 -0
- /package/dist/{src/iban.vo.d.ts → iban.vo.d.ts} +0 -0
- /package/dist/{src/iban.vo.js → iban.vo.js} +0 -0
- /package/dist/{src/image.vo.d.ts → image.vo.d.ts} +0 -0
- /package/dist/{src/image.vo.js → image.vo.js} +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/index.js → index.js} +0 -0
- /package/dist/{src/integer-non-negative.vo.d.ts → integer-non-negative.vo.d.ts} +0 -0
- /package/dist/{src/integer-non-negative.vo.js → integer-non-negative.vo.js} +0 -0
- /package/dist/{src/integer-positive.vo.d.ts → integer-positive.vo.d.ts} +0 -0
- /package/dist/{src/integer-positive.vo.js → integer-positive.vo.js} +0 -0
- /package/dist/{src/integer.vo.d.ts → integer.vo.d.ts} +0 -0
- /package/dist/{src/integer.vo.js → integer.vo.js} +0 -0
- /package/dist/{src/language.vo.d.ts → language.vo.d.ts} +0 -0
- /package/dist/{src/language.vo.js → language.vo.js} +0 -0
- /package/dist/{src/linear-regression.service.d.ts → linear-regression.service.d.ts} +0 -0
- /package/dist/{src/linear-regression.service.js → linear-regression.service.js} +0 -0
- /package/dist/{src/mean.service.d.ts → mean.service.d.ts} +0 -0
- /package/dist/{src/mean.service.js → mean.service.js} +0 -0
- /package/dist/{src/mime-registry-entry.vo.d.ts → mime-registry-entry.vo.d.ts} +0 -0
- /package/dist/{src/mime-registry-entry.vo.js → mime-registry-entry.vo.js} +0 -0
- /package/dist/{src/mime-registry.service.d.ts → mime-registry.service.d.ts} +0 -0
- /package/dist/{src/mime-registry.service.js → mime-registry.service.js} +0 -0
- /package/dist/{src/mime-value.vo.d.ts → mime-value.vo.d.ts} +0 -0
- /package/dist/{src/mime-value.vo.js → mime-value.vo.js} +0 -0
- /package/dist/{src/mime.vo.d.ts → mime.vo.d.ts} +0 -0
- /package/dist/{src/mime.vo.js → mime.vo.js} +0 -0
- /package/dist/{src/mimes.d.ts → mimes.d.ts} +0 -0
- /package/dist/{src/mimes.js → mimes.js} +0 -0
- /package/dist/{src/min-max-scaler.service.d.ts → min-max-scaler.service.d.ts} +0 -0
- /package/dist/{src/min-max-scaler.service.js → min-max-scaler.service.js} +0 -0
- /package/dist/{src/minute-value.vo.d.ts → minute-value.vo.d.ts} +0 -0
- /package/dist/{src/minute-value.vo.js → minute-value.vo.js} +0 -0
- /package/dist/{src/minute.vo.d.ts → minute.vo.d.ts} +0 -0
- /package/dist/{src/minute.vo.js → minute.vo.js} +0 -0
- /package/dist/{src/money-amount.vo.d.ts → money-amount.vo.d.ts} +0 -0
- /package/dist/{src/money-amount.vo.js → money-amount.vo.js} +0 -0
- /package/dist/{src/money.vo.d.ts → money.vo.d.ts} +0 -0
- /package/dist/{src/money.vo.js → money.vo.js} +0 -0
- /package/dist/{src/month-iso-id.vo.d.ts → month-iso-id.vo.d.ts} +0 -0
- /package/dist/{src/month-iso-id.vo.js → month-iso-id.vo.js} +0 -0
- /package/dist/{src/month.vo.d.ts → month.vo.d.ts} +0 -0
- /package/dist/{src/month.vo.js → month.vo.js} +0 -0
- /package/dist/{src/multiplication-factor.vo.d.ts → multiplication-factor.vo.d.ts} +0 -0
- /package/dist/{src/multiplication-factor.vo.js → multiplication-factor.vo.js} +0 -0
- /package/dist/{src/noop.service.d.ts → noop.service.d.ts} +0 -0
- /package/dist/{src/noop.service.js → noop.service.js} +0 -0
- /package/dist/{src/object-key.vo.d.ts → object-key.vo.d.ts} +0 -0
- /package/dist/{src/object-key.vo.js → object-key.vo.js} +0 -0
- /package/dist/{src/outlier-detector.service.d.ts → outlier-detector.service.d.ts} +0 -0
- /package/dist/{src/outlier-detector.service.js → outlier-detector.service.js} +0 -0
- /package/dist/{src/package-version-schema.vo.d.ts → package-version-schema.vo.d.ts} +0 -0
- /package/dist/{src/package-version-schema.vo.js → package-version-schema.vo.js} +0 -0
- /package/dist/{src/package-version.vo.d.ts → package-version.vo.d.ts} +0 -0
- /package/dist/{src/package-version.vo.js → package-version.vo.js} +0 -0
- /package/dist/{src/pagination-page.vo.d.ts → pagination-page.vo.d.ts} +0 -0
- /package/dist/{src/pagination-page.vo.js → pagination-page.vo.js} +0 -0
- /package/dist/{src/pagination-skip.vo.d.ts → pagination-skip.vo.d.ts} +0 -0
- /package/dist/{src/pagination-skip.vo.js → pagination-skip.vo.js} +0 -0
- /package/dist/{src/pagination-take.vo.d.ts → pagination-take.vo.d.ts} +0 -0
- /package/dist/{src/pagination-take.vo.js → pagination-take.vo.js} +0 -0
- /package/dist/{src/pagination.service.d.ts → pagination.service.d.ts} +0 -0
- /package/dist/{src/pagination.service.js → pagination.service.js} +0 -0
- /package/dist/{src/percentage.service.d.ts → percentage.service.d.ts} +0 -0
- /package/dist/{src/percentage.service.js → percentage.service.js} +0 -0
- /package/dist/{src/population-standard-deviation.service.d.ts → population-standard-deviation.service.d.ts} +0 -0
- /package/dist/{src/population-standard-deviation.service.js → population-standard-deviation.service.js} +0 -0
- /package/dist/{src/quarter-iso-id.vo.d.ts → quarter-iso-id.vo.d.ts} +0 -0
- /package/dist/{src/quarter-iso-id.vo.js → quarter-iso-id.vo.js} +0 -0
- /package/dist/{src/quarter.vo.d.ts → quarter.vo.d.ts} +0 -0
- /package/dist/{src/quarter.vo.js → quarter.vo.js} +0 -0
- /package/dist/{src/random.service.d.ts → random.service.d.ts} +0 -0
- /package/dist/{src/random.service.js → random.service.js} +0 -0
- /package/dist/{src/rate-limiter.service.d.ts → rate-limiter.service.d.ts} +0 -0
- /package/dist/{src/rate-limiter.service.js → rate-limiter.service.js} +0 -0
- /package/dist/{src/relative-date.vo.d.ts → relative-date.vo.d.ts} +0 -0
- /package/dist/{src/relative-date.vo.js → relative-date.vo.js} +0 -0
- /package/dist/{src/reordering-item-position-value.vo.d.ts → reordering-item-position-value.vo.d.ts} +0 -0
- /package/dist/{src/reordering-item-position-value.vo.js → reordering-item-position-value.vo.js} +0 -0
- /package/dist/{src/reordering.service.d.ts → reordering.service.d.ts} +0 -0
- /package/dist/{src/reordering.service.js → reordering.service.js} +0 -0
- /package/dist/{src/repeat.d.ts → repeat.d.ts} +0 -0
- /package/dist/{src/repeat.js → repeat.js} +0 -0
- /package/dist/{src/revision-value.vo.d.ts → revision-value.vo.d.ts} +0 -0
- /package/dist/{src/revision-value.vo.js → revision-value.vo.js} +0 -0
- /package/dist/{src/revision.vo.d.ts → revision.vo.d.ts} +0 -0
- /package/dist/{src/revision.vo.js → revision.vo.js} +0 -0
- /package/dist/{src/rounding-decimal.strategy.d.ts → rounding-decimal.strategy.d.ts} +0 -0
- /package/dist/{src/rounding-decimal.strategy.js → rounding-decimal.strategy.js} +0 -0
- /package/dist/{src/rounding-down.strategy.d.ts → rounding-down.strategy.d.ts} +0 -0
- /package/dist/{src/rounding-down.strategy.js → rounding-down.strategy.js} +0 -0
- /package/dist/{src/rounding-to-nearest.strategy.d.ts → rounding-to-nearest.strategy.d.ts} +0 -0
- /package/dist/{src/rounding-to-nearest.strategy.js → rounding-to-nearest.strategy.js} +0 -0
- /package/dist/{src/rounding-up.strategy.d.ts → rounding-up.strategy.d.ts} +0 -0
- /package/dist/{src/rounding-up.strategy.js → rounding-up.strategy.js} +0 -0
- /package/dist/{src/rounding.strategy.d.ts → rounding.strategy.d.ts} +0 -0
- /package/dist/{src/rounding.strategy.js → rounding.strategy.js} +0 -0
- /package/dist/{src/size-bytes.vo.d.ts → size-bytes.vo.d.ts} +0 -0
- /package/dist/{src/size-bytes.vo.js → size-bytes.vo.js} +0 -0
- /package/dist/{src/size.vo.d.ts → size.vo.d.ts} +0 -0
- /package/dist/{src/size.vo.js → size.vo.js} +0 -0
- /package/dist/{src/slug.service.d.ts → slug.service.d.ts} +0 -0
- /package/dist/{src/slug.service.js → slug.service.js} +0 -0
- /package/dist/{src/sum.service.d.ts → sum.service.d.ts} +0 -0
- /package/dist/{src/sum.service.js → sum.service.js} +0 -0
- /package/dist/{src/thousands-separator.service.d.ts → thousands-separator.service.d.ts} +0 -0
- /package/dist/{src/thousands-separator.service.js → thousands-separator.service.js} +0 -0
- /package/dist/{src/time-zone-offset-value.vo.d.ts → time-zone-offset-value.vo.d.ts} +0 -0
- /package/dist/{src/time-zone-offset-value.vo.js → time-zone-offset-value.vo.js} +0 -0
- /package/dist/{src/timestamp-value.vo.d.ts → timestamp-value.vo.d.ts} +0 -0
- /package/dist/{src/timestamp-value.vo.js → timestamp-value.vo.js} +0 -0
- /package/dist/{src/timestamp.vo.d.ts → timestamp.vo.d.ts} +0 -0
- /package/dist/{src/timestamp.vo.js → timestamp.vo.js} +0 -0
- /package/dist/{src/timezone.vo.d.ts → timezone.vo.d.ts} +0 -0
- /package/dist/{src/timezone.vo.js → timezone.vo.js} +0 -0
- /package/dist/{src/ts-utils.d.ts → ts-utils.d.ts} +0 -0
- /package/dist/{src/ts-utils.js → ts-utils.js} +0 -0
- /package/dist/{src/url-with-slash.vo.d.ts → url-with-slash.vo.d.ts} +0 -0
- /package/dist/{src/url-with-slash.vo.js → url-with-slash.vo.js} +0 -0
- /package/dist/{src/url-without-slash.vo.d.ts → url-without-slash.vo.d.ts} +0 -0
- /package/dist/{src/url-without-slash.vo.js → url-without-slash.vo.js} +0 -0
- /package/dist/{src/visually-unambiguous-characters-generator.service.d.ts → visually-unambiguous-characters-generator.service.d.ts} +0 -0
- /package/dist/{src/visually-unambiguous-characters-generator.service.js → visually-unambiguous-characters-generator.service.js} +0 -0
- /package/dist/{src/week-iso-id.vo.d.ts → week-iso-id.vo.d.ts} +0 -0
- /package/dist/{src/week-iso-id.vo.js → week-iso-id.vo.js} +0 -0
- /package/dist/{src/week.vo.d.ts → week.vo.d.ts} +0 -0
- /package/dist/{src/week.vo.js → week.vo.js} +0 -0
- /package/dist/{src/weekday-iso-id.vo.d.ts → weekday-iso-id.vo.d.ts} +0 -0
- /package/dist/{src/weekday-iso-id.vo.js → weekday-iso-id.vo.js} +0 -0
- /package/dist/{src/weekday.vo.d.ts → weekday.vo.d.ts} +0 -0
- /package/dist/{src/weekday.vo.js → weekday.vo.js} +0 -0
- /package/dist/{src/weight-grams.vo.d.ts → weight-grams.vo.d.ts} +0 -0
- /package/dist/{src/weight-grams.vo.js → weight-grams.vo.js} +0 -0
- /package/dist/{src/weight.vo.d.ts → weight.vo.d.ts} +0 -0
- /package/dist/{src/weight.vo.js → weight.vo.js} +0 -0
- /package/dist/{src/year-iso-id.vo.d.ts → year-iso-id.vo.d.ts} +0 -0
- /package/dist/{src/year-iso-id.vo.js → year-iso-id.vo.js} +0 -0
- /package/dist/{src/year.vo.d.ts → year.vo.d.ts} +0 -0
- /package/dist/{src/year.vo.js → year.vo.js} +0 -0
- /package/dist/{src/z-score.service.d.ts → z-score.service.d.ts} +0 -0
- /package/dist/{src/z-score.service.js → z-score.service.js} +0 -0
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { OutlierDetector } from "../src/outlier-detector.service";
|
|
3
|
-
describe("Outlier detector", () => {
|
|
4
|
-
test("throws for empty values array", () => {
|
|
5
|
-
expect(() => new OutlierDetector([], 2)).toThrow("outlier.detector.not.enough.values");
|
|
6
|
-
});
|
|
7
|
-
test("throws for one value array", () => {
|
|
8
|
-
expect(() => new OutlierDetector([1], 2)).toThrow("outlier.detector.not.enough.values");
|
|
9
|
-
});
|
|
10
|
-
test("works for three values", () => {
|
|
11
|
-
const values = [1, 3];
|
|
12
|
-
const detector = new OutlierDetector(values, 2);
|
|
13
|
-
expect(values.filter((value) => detector.isInlier(value))).toEqual([1, 3]);
|
|
14
|
-
});
|
|
15
|
-
test("works for three values", () => {
|
|
16
|
-
const values = [1, 3, 10];
|
|
17
|
-
const detector = new OutlierDetector(values, 2);
|
|
18
|
-
expect(values.filter((value) => detector.isInlier(value))).toEqual([1, 3, 10]);
|
|
19
|
-
});
|
|
20
|
-
test("works for a set of data", () => {
|
|
21
|
-
const values = [1, 3, 1, 3, 1, 3, 10];
|
|
22
|
-
const detector = new OutlierDetector(values, 2);
|
|
23
|
-
expect(values.filter((value) => detector.isInlier(value))).toEqual([1, 3, 1, 3, 1, 3]);
|
|
24
|
-
expect(detector.isInlier(10)).toEqual(false);
|
|
25
|
-
});
|
|
26
|
-
test("works for all zeros", () => {
|
|
27
|
-
const values = [0, 0, 0, 0];
|
|
28
|
-
const detector = new OutlierDetector(values, 2);
|
|
29
|
-
expect(values.filter((value) => detector.isInlier(value))).toEqual([]);
|
|
30
|
-
});
|
|
31
|
-
test("works score equal to threshold ", () => {
|
|
32
|
-
const detector = new OutlierDetector([10, 30], 0);
|
|
33
|
-
expect(detector.isInlier(20)).toEqual(true);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import * as v from "valibot";
|
|
3
|
-
import { PackageVersionSchema } from "../src/package-version-schema.vo";
|
|
4
|
-
describe("PackageVersionSchema", () => {
|
|
5
|
-
test("happy path", () => {
|
|
6
|
-
const valid = ["v0.0.0", "v1.10.0", "v9999.9999.9999"];
|
|
7
|
-
for (const value of valid) {
|
|
8
|
-
expect(v.safeParse(PackageVersionSchema, value).success).toEqual(true);
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
test("rejects prefix", () => {
|
|
12
|
-
expect(() => v.parse(PackageVersionSchema, " v1.0.0")).toThrow("package.version.schema.bad.chars");
|
|
13
|
-
});
|
|
14
|
-
test("rejects suffix", () => {
|
|
15
|
-
expect(() => v.parse(PackageVersionSchema, "v1.0.0 ")).toThrow("package.version.schema.bad.chars");
|
|
16
|
-
});
|
|
17
|
-
test("rejects empty value", () => {
|
|
18
|
-
expect(() => v.parse(PackageVersionSchema, "")).toThrow("package.version.schema.bad.chars");
|
|
19
|
-
});
|
|
20
|
-
test("rejects non-string - null", () => {
|
|
21
|
-
expect(() => v.parse(PackageVersionSchema, null)).toThrow("package.version.schema.error");
|
|
22
|
-
});
|
|
23
|
-
test("rejects non-string - number", () => {
|
|
24
|
-
expect(() => v.parse(PackageVersionSchema, 123)).toThrow("package.version.schema.error");
|
|
25
|
-
});
|
|
26
|
-
test("rejects invalid values", () => {
|
|
27
|
-
const invalid = ["v", "v1", "v1.0", "0.0.0", "vx.0.0", "v1.x.0", "v1.1.x"];
|
|
28
|
-
for (const value of invalid) {
|
|
29
|
-
expect(() => v.parse(PackageVersionSchema, value)).toThrow("package.version.schema.bad.chars");
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import * as v from "valibot";
|
|
3
|
-
import { PackageVersion } from "../src/package-version.vo";
|
|
4
|
-
import { PackageVersionSchema } from "../src/package-version-schema.vo";
|
|
5
|
-
describe("PackageVersion", () => {
|
|
6
|
-
test("fromVersionString", () => {
|
|
7
|
-
const version = PackageVersion.fromVersionString("v1.2.3");
|
|
8
|
-
expect(version.toJSON()).toEqual({ major: 1, minor: 2, patch: 3 });
|
|
9
|
-
});
|
|
10
|
-
test("fromVersionStringSafe", () => {
|
|
11
|
-
const version = PackageVersion.fromVersionStringSafe(v.parse(PackageVersionSchema, "v1.2.3"));
|
|
12
|
-
expect(version.toJSON()).toEqual({ major: 1, minor: 2, patch: 3 });
|
|
13
|
-
});
|
|
14
|
-
test("equals - true", () => {
|
|
15
|
-
const left = PackageVersion.fromString("1.2.3");
|
|
16
|
-
const right = PackageVersion.fromString("1.2.3");
|
|
17
|
-
expect(left.equals(right)).toEqual(true);
|
|
18
|
-
});
|
|
19
|
-
test("equals - false - major mismatch", () => {
|
|
20
|
-
const left = PackageVersion.fromString("2.1.1");
|
|
21
|
-
const right = PackageVersion.fromString("1.1.1");
|
|
22
|
-
expect(left.equals(right)).toEqual(false);
|
|
23
|
-
});
|
|
24
|
-
test("equals - false - minor mismatch", () => {
|
|
25
|
-
const left = PackageVersion.fromString("1.2.1");
|
|
26
|
-
const right = PackageVersion.fromString("1.1.1");
|
|
27
|
-
expect(left.equals(right)).toEqual(false);
|
|
28
|
-
});
|
|
29
|
-
test("equals - false - patch mismatch", () => {
|
|
30
|
-
const left = PackageVersion.fromString("1.1.2");
|
|
31
|
-
const right = PackageVersion.fromString("1.1.1");
|
|
32
|
-
expect(left.equals(right)).toEqual(false);
|
|
33
|
-
});
|
|
34
|
-
test("greater - major", () => {
|
|
35
|
-
const left = PackageVersion.fromString("2.0.0");
|
|
36
|
-
const right = PackageVersion.fromString("1.9.9");
|
|
37
|
-
expect(left.isGreaterThan(right)).toEqual(true);
|
|
38
|
-
expect(right.isGreaterThan(left)).toEqual(false);
|
|
39
|
-
});
|
|
40
|
-
test("greater - minor", () => {
|
|
41
|
-
const left = PackageVersion.fromString("1.2.0");
|
|
42
|
-
const right = PackageVersion.fromString("1.1.9");
|
|
43
|
-
expect(left.isGreaterThan(right)).toEqual(true);
|
|
44
|
-
expect(right.isGreaterThan(left)).toEqual(false);
|
|
45
|
-
});
|
|
46
|
-
test("greater - patch", () => {
|
|
47
|
-
const left = PackageVersion.fromString("1.1.2");
|
|
48
|
-
const right = PackageVersion.fromString("1.1.1");
|
|
49
|
-
expect(left.isGreaterThan(right)).toEqual(true);
|
|
50
|
-
expect(right.isGreaterThan(left)).toEqual(false);
|
|
51
|
-
});
|
|
52
|
-
test("greater - false - equal", () => {
|
|
53
|
-
const left = PackageVersion.fromString("1.2.3");
|
|
54
|
-
const right = PackageVersion.fromString("1.2.3");
|
|
55
|
-
expect(left.isGreaterThan(right)).toEqual(false);
|
|
56
|
-
});
|
|
57
|
-
test("greater - false - major smaller", () => {
|
|
58
|
-
const left = PackageVersion.fromString("1.0.0");
|
|
59
|
-
const right = PackageVersion.fromString("2.0.0");
|
|
60
|
-
expect(left.isGreaterThan(right)).toEqual(false);
|
|
61
|
-
});
|
|
62
|
-
test("greater - false - minor smaller", () => {
|
|
63
|
-
const left = PackageVersion.fromString("1.1.0");
|
|
64
|
-
const right = PackageVersion.fromString("1.2.0");
|
|
65
|
-
expect(left.isGreaterThan(right)).toEqual(false);
|
|
66
|
-
});
|
|
67
|
-
test("greaterOrEqual - equal", () => {
|
|
68
|
-
const left = PackageVersion.fromString("1.2.3");
|
|
69
|
-
const right = PackageVersion.fromString("1.2.3");
|
|
70
|
-
expect(left.isGreaterThanOrEqual(right)).toEqual(true);
|
|
71
|
-
});
|
|
72
|
-
test("greaterOrEqual - greater", () => {
|
|
73
|
-
const left = PackageVersion.fromString("1.2.4");
|
|
74
|
-
const right = PackageVersion.fromString("1.2.3");
|
|
75
|
-
expect(left.isGreaterThanOrEqual(right)).toEqual(true);
|
|
76
|
-
});
|
|
77
|
-
test("greaterOrEqual - false - smaller", () => {
|
|
78
|
-
const left = PackageVersion.fromString("1.2.2");
|
|
79
|
-
const right = PackageVersion.fromString("1.2.3");
|
|
80
|
-
expect(left.isGreaterThanOrEqual(right)).toEqual(false);
|
|
81
|
-
});
|
|
82
|
-
test("smaller - major", () => {
|
|
83
|
-
const left = PackageVersion.fromString("1.0.0");
|
|
84
|
-
const right = PackageVersion.fromString("2.0.0");
|
|
85
|
-
expect(left.isSmallerThan(right)).toEqual(true);
|
|
86
|
-
expect(right.isSmallerThan(left)).toEqual(false);
|
|
87
|
-
});
|
|
88
|
-
test("smaller - minor", () => {
|
|
89
|
-
const left = PackageVersion.fromString("1.1.0");
|
|
90
|
-
const right = PackageVersion.fromString("1.2.0");
|
|
91
|
-
expect(left.isSmallerThan(right)).toEqual(true);
|
|
92
|
-
expect(right.isSmallerThan(left)).toEqual(false);
|
|
93
|
-
});
|
|
94
|
-
test("smaller - patch", () => {
|
|
95
|
-
const left = PackageVersion.fromString("1.1.1");
|
|
96
|
-
const right = PackageVersion.fromString("1.1.2");
|
|
97
|
-
expect(left.isSmallerThan(right)).toEqual(true);
|
|
98
|
-
expect(right.isSmallerThan(left)).toEqual(false);
|
|
99
|
-
});
|
|
100
|
-
test("smaller - false - equal", () => {
|
|
101
|
-
const left = PackageVersion.fromString("1.2.3");
|
|
102
|
-
const right = PackageVersion.fromString("1.2.3");
|
|
103
|
-
expect(left.isSmallerThan(right)).toEqual(false);
|
|
104
|
-
});
|
|
105
|
-
test("smaller - false - major greater", () => {
|
|
106
|
-
const left = PackageVersion.fromString("2.0.0");
|
|
107
|
-
const right = PackageVersion.fromString("1.0.0");
|
|
108
|
-
expect(left.isSmallerThan(right)).toEqual(false);
|
|
109
|
-
});
|
|
110
|
-
test("smaller - false - minor greater", () => {
|
|
111
|
-
const left = PackageVersion.fromString("1.2.0");
|
|
112
|
-
const right = PackageVersion.fromString("1.1.0");
|
|
113
|
-
expect(left.isSmallerThan(right)).toEqual(false);
|
|
114
|
-
});
|
|
115
|
-
test("smallerOrEqual - equal", () => {
|
|
116
|
-
const left = PackageVersion.fromString("1.2.3");
|
|
117
|
-
const right = PackageVersion.fromString("1.2.3");
|
|
118
|
-
expect(left.isSmallerThanOrEqual(right)).toEqual(true);
|
|
119
|
-
});
|
|
120
|
-
test("smallerOrEqual - smaller", () => {
|
|
121
|
-
const left = PackageVersion.fromString("1.2.2");
|
|
122
|
-
const right = PackageVersion.fromString("1.2.3");
|
|
123
|
-
expect(left.isSmallerThanOrEqual(right)).toEqual(true);
|
|
124
|
-
});
|
|
125
|
-
test("smallerOrEqual - false - greater", () => {
|
|
126
|
-
const left = PackageVersion.fromString("1.2.4");
|
|
127
|
-
const right = PackageVersion.fromString("1.2.3");
|
|
128
|
-
expect(left.isSmallerThanOrEqual(right)).toEqual(false);
|
|
129
|
-
});
|
|
130
|
-
test("toString", () => {
|
|
131
|
-
const version = PackageVersion.fromString("3.4.5");
|
|
132
|
-
expect(version.toString()).toEqual("3.4.5");
|
|
133
|
-
});
|
|
134
|
-
test("toJSON", () => {
|
|
135
|
-
const version = PackageVersion.fromString("3.4.5");
|
|
136
|
-
expect(version.toJSON()).toEqual({ major: 3, minor: 4, patch: 5 });
|
|
137
|
-
});
|
|
138
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import * as v from "valibot";
|
|
3
|
-
import { Page } from "../src/pagination-page.vo";
|
|
4
|
-
describe("PaginationPage", () => {
|
|
5
|
-
test("happy path", () => {
|
|
6
|
-
expect(v.safeParse(Page, 0).success).toEqual(true);
|
|
7
|
-
expect(v.safeParse(Page, 1).success).toEqual(true);
|
|
8
|
-
expect(v.safeParse(Page, 5).success).toEqual(true);
|
|
9
|
-
expect(v.safeParse(Page, 15).success).toEqual(true);
|
|
10
|
-
});
|
|
11
|
-
test("transforms null to 1", () => {
|
|
12
|
-
expect(v.safeParse(Page, null)).toMatchObject({ success: true, output: 1 });
|
|
13
|
-
});
|
|
14
|
-
test("transforms undefined to 1", () => {
|
|
15
|
-
expect(v.safeParse(Page, undefined)).toMatchObject({ success: true, output: 1 });
|
|
16
|
-
});
|
|
17
|
-
test("transforms string to int", () => {
|
|
18
|
-
expect(v.safeParse(Page, "123")).toMatchObject({ success: true, output: 123 });
|
|
19
|
-
});
|
|
20
|
-
test("transforms negative numbers to 1", () => {
|
|
21
|
-
expect(v.safeParse(Page, -2)).toMatchObject({ success: true, output: 1 });
|
|
22
|
-
});
|
|
23
|
-
test("rejects fractions", () => {
|
|
24
|
-
expect(() => v.parse(Page, 1.5)).toThrow("pagination.page.type");
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import * as v from "valibot";
|
|
3
|
-
import { Skip } from "../src/pagination-skip.vo";
|
|
4
|
-
describe("PaginationSkip", () => {
|
|
5
|
-
test("happy path", () => {
|
|
6
|
-
expect(v.safeParse(Skip, 0).success).toEqual(true);
|
|
7
|
-
expect(v.safeParse(Skip, 1).success).toEqual(true);
|
|
8
|
-
expect(v.safeParse(Skip, 5).success).toEqual(true);
|
|
9
|
-
expect(v.safeParse(Skip, 15).success).toEqual(true);
|
|
10
|
-
});
|
|
11
|
-
test("rejects non-number - null", () => {
|
|
12
|
-
expect(() => v.parse(Skip, null)).toThrow("pagination.skip.type");
|
|
13
|
-
});
|
|
14
|
-
test("rejects non-number - string", () => {
|
|
15
|
-
expect(() => v.parse(Skip, "123")).toThrow("pagination.skip.type");
|
|
16
|
-
});
|
|
17
|
-
test("rejects fractions", () => {
|
|
18
|
-
expect(() => v.parse(Skip, 1.5)).toThrow("pagination.skip.type");
|
|
19
|
-
});
|
|
20
|
-
test("rejects negative numbers", () => {
|
|
21
|
-
expect(() => v.parse(Skip, -1)).toThrow("pagination.skip.invalid");
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import * as v from "valibot";
|
|
3
|
-
import { Take } from "../src/pagination-take.vo";
|
|
4
|
-
describe("PaginationTake", () => {
|
|
5
|
-
test("happy path", () => {
|
|
6
|
-
expect(v.safeParse(Take, 1).success).toEqual(true);
|
|
7
|
-
expect(v.safeParse(Take, 5).success).toEqual(true);
|
|
8
|
-
expect(v.safeParse(Take, 15).success).toEqual(true);
|
|
9
|
-
});
|
|
10
|
-
test("rejects non-number - null", () => {
|
|
11
|
-
expect(() => v.parse(Take, null)).toThrow("pagination.take.type");
|
|
12
|
-
});
|
|
13
|
-
test("rejects non-number - string", () => {
|
|
14
|
-
expect(() => v.parse(Take, "123")).toThrow("pagination.take.type");
|
|
15
|
-
});
|
|
16
|
-
test("rejects fractions", () => {
|
|
17
|
-
expect(() => v.parse(Take, 1.5)).toThrow("pagination.take.type");
|
|
18
|
-
});
|
|
19
|
-
test("rejects zero", () => {
|
|
20
|
-
expect(() => v.parse(Take, 0)).toThrow("pagination.take.invalid");
|
|
21
|
-
});
|
|
22
|
-
test("rejects negative numbers", () => {
|
|
23
|
-
expect(() => v.parse(Take, -1)).toThrow("pagination.take.invalid");
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { Pagination } from "../src/pagination.service";
|
|
3
|
-
describe("Pagination", () => {
|
|
4
|
-
test("page 0, take 10", () => {
|
|
5
|
-
const take = 10;
|
|
6
|
-
const parsed = Pagination.parse({ page: 0 }, take);
|
|
7
|
-
expect(parsed.page).toEqual(1);
|
|
8
|
-
expect(parsed.values.take).toEqual(take);
|
|
9
|
-
expect(parsed.values.skip).toEqual(0);
|
|
10
|
-
});
|
|
11
|
-
test("page 1, take 10", () => {
|
|
12
|
-
const take = 10;
|
|
13
|
-
const page = 1;
|
|
14
|
-
const parsed = Pagination.parse({ page }, take);
|
|
15
|
-
expect(parsed.page).toEqual(page);
|
|
16
|
-
expect(parsed.values.take).toEqual(take);
|
|
17
|
-
expect(parsed.values.skip).toEqual(0);
|
|
18
|
-
});
|
|
19
|
-
test("page 2, take 10", () => {
|
|
20
|
-
const take = 10;
|
|
21
|
-
const parsed = Pagination.parse({ page: 2 }, take);
|
|
22
|
-
expect(parsed.page).toEqual(2);
|
|
23
|
-
expect(parsed.values.take).toEqual(10);
|
|
24
|
-
expect(parsed.values.skip).toEqual(10);
|
|
25
|
-
});
|
|
26
|
-
test("page -1, take 10", () => {
|
|
27
|
-
const take = 10;
|
|
28
|
-
const parsed = Pagination.parse({ page: -1 }, take);
|
|
29
|
-
expect(parsed.page).toEqual(1);
|
|
30
|
-
expect(parsed.values.take).toEqual(take);
|
|
31
|
-
expect(parsed.values.skip).toEqual(0);
|
|
32
|
-
});
|
|
33
|
-
test("prepares paged metadata", () => {
|
|
34
|
-
const config = {
|
|
35
|
-
total: 50,
|
|
36
|
-
pagination: { values: { take: 10, skip: 10 }, page: 2 },
|
|
37
|
-
result: [11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
|
|
38
|
-
};
|
|
39
|
-
const paged = Pagination.prepare(config);
|
|
40
|
-
expect(paged.result).toEqual([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);
|
|
41
|
-
expect(paged.meta.exhausted).toEqual(false);
|
|
42
|
-
expect(paged.meta.currentPage).toEqual(2);
|
|
43
|
-
expect(paged.meta.previousPage).toEqual(1);
|
|
44
|
-
expect(paged.meta.nextPage).toEqual(3);
|
|
45
|
-
expect(paged.meta.lastPage).toEqual(5);
|
|
46
|
-
expect(paged.meta.total).toEqual(50);
|
|
47
|
-
});
|
|
48
|
-
test("empty paged data", () => {
|
|
49
|
-
const emptyPaged = Pagination.empty;
|
|
50
|
-
expect(emptyPaged.result).toEqual([]);
|
|
51
|
-
expect(emptyPaged.meta.exhausted).toEqual(true);
|
|
52
|
-
expect(emptyPaged.meta.currentPage).toEqual(1);
|
|
53
|
-
expect(emptyPaged.meta.previousPage).toEqual(undefined);
|
|
54
|
-
expect(emptyPaged.meta.nextPage).toEqual(undefined);
|
|
55
|
-
expect(emptyPaged.meta.lastPage).toEqual(1);
|
|
56
|
-
expect(emptyPaged.meta.total).toEqual(0);
|
|
57
|
-
});
|
|
58
|
-
test("prepare - first page boundary", () => {
|
|
59
|
-
const config = {
|
|
60
|
-
total: 50,
|
|
61
|
-
pagination: { values: { take: 10, skip: 0 }, page: 1 },
|
|
62
|
-
result: [],
|
|
63
|
-
};
|
|
64
|
-
const paged = Pagination.prepare(config);
|
|
65
|
-
expect(paged.meta.currentPage).toEqual(1);
|
|
66
|
-
expect(paged.meta.previousPage).toBeUndefined();
|
|
67
|
-
expect(paged.meta.nextPage).toEqual(2);
|
|
68
|
-
});
|
|
69
|
-
test("prepare - last page boundary", () => {
|
|
70
|
-
const config = {
|
|
71
|
-
total: 50,
|
|
72
|
-
pagination: { values: { take: 10, skip: 40 }, page: 5 },
|
|
73
|
-
result: [],
|
|
74
|
-
};
|
|
75
|
-
const paged = Pagination.prepare(config);
|
|
76
|
-
expect(paged.meta.currentPage).toEqual(5);
|
|
77
|
-
expect(paged.meta.lastPage).toEqual(5);
|
|
78
|
-
expect(paged.meta.previousPage).toEqual(4);
|
|
79
|
-
expect(paged.meta.nextPage).toBeUndefined();
|
|
80
|
-
});
|
|
81
|
-
test("isExhausted", () => {
|
|
82
|
-
const config = { total: 25, pagination: { values: { take: 10, skip: 10 }, page: 3 } };
|
|
83
|
-
const exhausted = Pagination.isExhausted(config);
|
|
84
|
-
expect(exhausted).toEqual(true);
|
|
85
|
-
});
|
|
86
|
-
test("getFirstPage", () => {
|
|
87
|
-
const firstPage = Pagination.getFirstPage({ take: 15 });
|
|
88
|
-
expect(firstPage.page).toEqual(1);
|
|
89
|
-
expect(firstPage.values.take).toEqual(15);
|
|
90
|
-
expect(firstPage.values.skip).toEqual(0);
|
|
91
|
-
});
|
|
92
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { Percentage } from "../src/percentage.service";
|
|
3
|
-
import { RoundingUpStrategy } from "../src/rounding-up.strategy";
|
|
4
|
-
describe("Percentage", () => {
|
|
5
|
-
test("happy path", () => {
|
|
6
|
-
expect(Percentage.of(0, 2)).toEqual(0);
|
|
7
|
-
expect(Percentage.of(1, 2)).toEqual(50);
|
|
8
|
-
expect(Percentage.of(1, 3)).toEqual(33);
|
|
9
|
-
});
|
|
10
|
-
test("throws - invalid denominator", () => {
|
|
11
|
-
expect(() => Percentage.of(2, 0)).toThrow("percentage.invalid.denominator");
|
|
12
|
-
});
|
|
13
|
-
test("non-default rounding", () => {
|
|
14
|
-
expect(Percentage.of(1, 3, new RoundingUpStrategy())).toEqual(34);
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { PopulationStandardDeviation } from "../src/population-standard-deviation.service";
|
|
3
|
-
describe("Standard deviation", () => {
|
|
4
|
-
test("throws - empty array", () => {
|
|
5
|
-
expect(() => PopulationStandardDeviation.calculate([])).toThrow("population.standard.deviation.not.enough.values");
|
|
6
|
-
});
|
|
7
|
-
test("throws - single value", () => {
|
|
8
|
-
expect(() => PopulationStandardDeviation.calculate([1])).toThrow("population.standard.deviation.not.enough.values");
|
|
9
|
-
});
|
|
10
|
-
test("two values", () => {
|
|
11
|
-
expect(PopulationStandardDeviation.calculate([1, 2])).toEqual(0.5);
|
|
12
|
-
});
|
|
13
|
-
test("three values", () => {
|
|
14
|
-
expect(PopulationStandardDeviation.calculate([1, 2, 3])).toEqual(0.82);
|
|
15
|
-
});
|
|
16
|
-
test("set of numbers", () => {
|
|
17
|
-
expect(PopulationStandardDeviation.calculate([2, 4, 4, 4, 5, 5, 7, 9])).toEqual(2);
|
|
18
|
-
expect(PopulationStandardDeviation.calculate([1, 1, 1, 1, 1, 1, 10])).toEqual(3.15);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import * as v from "valibot";
|
|
3
|
-
import { QuarterIsoId } from "../src/quarter-iso-id.vo";
|
|
4
|
-
describe("QuarterIsoId", () => {
|
|
5
|
-
test("happy path", () => {
|
|
6
|
-
const valid = ["0000-Q1", "1970-Q1", "1999-Q4", "2024-Q2", "2025-Q3", "9999-Q4"];
|
|
7
|
-
for (const value of valid) {
|
|
8
|
-
expect(v.safeParse(QuarterIsoId, value).success).toEqual(true);
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
test("rejects empty", () => {
|
|
12
|
-
expect(() => v.parse(QuarterIsoId, "")).toThrow("quarter.iso.id.bad.chars");
|
|
13
|
-
});
|
|
14
|
-
test("rejects non-string - null", () => {
|
|
15
|
-
expect(() => v.parse(QuarterIsoId, null)).toThrow("quarter.iso.id.type");
|
|
16
|
-
});
|
|
17
|
-
test("rejects non-string - number", () => {
|
|
18
|
-
expect(() => v.parse(QuarterIsoId, 123)).toThrow("quarter.iso.id.type");
|
|
19
|
-
});
|
|
20
|
-
test("rejects quarters < 1 and > 4", () => {
|
|
21
|
-
expect(() => v.parse(QuarterIsoId, "2025-Q0")).toThrow("quarter.iso.id.bad.chars");
|
|
22
|
-
expect(() => v.parse(QuarterIsoId, "2025-Q5")).toThrow("quarter.iso.id.bad.chars");
|
|
23
|
-
});
|
|
24
|
-
test("rejects structurally invalid strings", () => {
|
|
25
|
-
const invalid = ["2025Q1", "2025-Q", "25-Q1", "2025-q1", "2025-QA", "2025-01"];
|
|
26
|
-
for (const value of invalid) {
|
|
27
|
-
expect(() => v.parse(QuarterIsoId, value)).toThrow("quarter.iso.id.bad.chars");
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { endOfQuarter, startOfQuarter } from "date-fns";
|
|
3
|
-
import * as v from "valibot";
|
|
4
|
-
import { Duration } from "../src/duration.service";
|
|
5
|
-
import { Quarter } from "../src/quarter.vo";
|
|
6
|
-
import { QuarterIsoId } from "../src/quarter-iso-id.vo";
|
|
7
|
-
import { Timestamp } from "../src/timestamp.vo";
|
|
8
|
-
import * as mocks from "./mocks";
|
|
9
|
-
const q4 = v.parse(QuarterIsoId, "2023-Q4");
|
|
10
|
-
describe("Quarter", () => {
|
|
11
|
-
test("happy path", () => {
|
|
12
|
-
const quarter = Quarter.fromTimestamp(mocks.TIME_ZERO);
|
|
13
|
-
expect(quarter.getStart()).toEqual(Timestamp.fromNumber(startOfQuarter(mocks.TIME_ZERO.ms).getTime()));
|
|
14
|
-
expect(quarter.getEnd()).toEqual(Timestamp.fromNumber(endOfQuarter(mocks.TIME_ZERO.ms).getTime()));
|
|
15
|
-
expect(quarter.toIsoId()).toEqual(q4);
|
|
16
|
-
expect(quarter.contains(mocks.TIME_ZERO)).toEqual(true);
|
|
17
|
-
});
|
|
18
|
-
test("happy path - near year boundary", () => {
|
|
19
|
-
const timestamp = Timestamp.fromDateLike("2025-12-31T23:59:59Z");
|
|
20
|
-
const quarter = Quarter.fromTimestamp(timestamp);
|
|
21
|
-
expect(quarter.getStart()).toEqual(Timestamp.fromNumber(startOfQuarter(timestamp.ms).getTime()));
|
|
22
|
-
expect(quarter.getEnd()).toEqual(Timestamp.fromNumber(endOfQuarter(timestamp.ms).getTime()));
|
|
23
|
-
expect(quarter.toIsoId()).toEqual(v.parse(QuarterIsoId, "2025-Q4"));
|
|
24
|
-
});
|
|
25
|
-
test("fromNow", () => {
|
|
26
|
-
expect(Quarter.fromNow(mocks.TIME_ZERO).toIsoId()).toEqual(q4);
|
|
27
|
-
});
|
|
28
|
-
test("fromTimestamp", () => {
|
|
29
|
-
expect(Quarter.fromTimestamp(mocks.TIME_ZERO).toIsoId()).toEqual(q4);
|
|
30
|
-
});
|
|
31
|
-
test("fromTimestampValue", () => {
|
|
32
|
-
expect(Quarter.fromTimestampValue(mocks.TIME_ZERO.ms).toIsoId()).toEqual(q4);
|
|
33
|
-
});
|
|
34
|
-
test("fromIsoId", () => {
|
|
35
|
-
expect(Quarter.fromIsoId(q4).toIsoId()).toEqual(q4);
|
|
36
|
-
});
|
|
37
|
-
test("round-trips", () => {
|
|
38
|
-
const ids = ["1970-Q1", "1999-Q4", "2024-Q2", "2025-Q3", "2026-Q1"];
|
|
39
|
-
for (const id of ids) {
|
|
40
|
-
expect(Quarter.fromIsoId(v.parse(QuarterIsoId, id)).toIsoId()).toEqual(v.parse(QuarterIsoId, id));
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
test("contains", () => {
|
|
44
|
-
const quarter = Quarter.fromTimestamp(mocks.TIME_ZERO);
|
|
45
|
-
expect(quarter.contains(quarter.getStart().subtract(Duration.Ms(1)))).toEqual(false);
|
|
46
|
-
expect(quarter.contains(quarter.getEnd().add(Duration.Ms(1)))).toEqual(false);
|
|
47
|
-
});
|
|
48
|
-
test("toString", () => {
|
|
49
|
-
expect(Quarter.fromIsoId(q4).toString()).toEqual("2023-Q4");
|
|
50
|
-
});
|
|
51
|
-
test("toJSON", () => {
|
|
52
|
-
expect(Quarter.fromIsoId(q4).toJSON()).toEqual({ start: 1696118400000, end: 1704067199999 });
|
|
53
|
-
});
|
|
54
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
-
if (value !== null && value !== void 0) {
|
|
3
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
-
var dispose, inner;
|
|
5
|
-
if (async) {
|
|
6
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
-
dispose = value[Symbol.asyncDispose];
|
|
8
|
-
}
|
|
9
|
-
if (dispose === void 0) {
|
|
10
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
-
dispose = value[Symbol.dispose];
|
|
12
|
-
if (async) inner = dispose;
|
|
13
|
-
}
|
|
14
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
-
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
-
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
-
}
|
|
18
|
-
else if (async) {
|
|
19
|
-
env.stack.push({ async: true });
|
|
20
|
-
}
|
|
21
|
-
return value;
|
|
22
|
-
};
|
|
23
|
-
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
-
return function (env) {
|
|
25
|
-
function fail(e) {
|
|
26
|
-
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
-
env.hasError = true;
|
|
28
|
-
}
|
|
29
|
-
var r, s = 0;
|
|
30
|
-
function next() {
|
|
31
|
-
while (r = env.stack.pop()) {
|
|
32
|
-
try {
|
|
33
|
-
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
-
if (r.dispose) {
|
|
35
|
-
var result = r.dispose.call(r.value);
|
|
36
|
-
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
-
}
|
|
38
|
-
else s |= 1;
|
|
39
|
-
}
|
|
40
|
-
catch (e) {
|
|
41
|
-
fail(e);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
-
if (env.hasError) throw env.error;
|
|
46
|
-
}
|
|
47
|
-
return next();
|
|
48
|
-
};
|
|
49
|
-
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
-
var e = new Error(message);
|
|
51
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
-
});
|
|
53
|
-
import { describe, expect, spyOn, test } from "bun:test";
|
|
54
|
-
import { Random } from "../src/random.service";
|
|
55
|
-
describe("Random", () => {
|
|
56
|
-
test("throws when min equals max", () => {
|
|
57
|
-
expect(() => Random.generate({ min: 1, max: 1 })).toThrow("random.min.max");
|
|
58
|
-
});
|
|
59
|
-
test("throws when min greater than max", () => {
|
|
60
|
-
expect(() => Random.generate({ min: 2, max: 1 })).toThrow("random.min.max");
|
|
61
|
-
});
|
|
62
|
-
test("throws when all zeros", () => {
|
|
63
|
-
expect(() => Random.generate({ min: 0, max: 0 })).toThrow("random.min.max");
|
|
64
|
-
});
|
|
65
|
-
test("generate - default config", () => {
|
|
66
|
-
const result = Random.generate();
|
|
67
|
-
expect(result).toBeGreaterThanOrEqual(0);
|
|
68
|
-
expect(result).toBeLessThanOrEqual(1);
|
|
69
|
-
});
|
|
70
|
-
test("generate - min 1, max 10", () => {
|
|
71
|
-
const result = Random.generate({ min: 1, max: 10 });
|
|
72
|
-
expect(result).toBeGreaterThanOrEqual(1);
|
|
73
|
-
expect(result).toBeLessThanOrEqual(10);
|
|
74
|
-
});
|
|
75
|
-
test("calculation integrity", () => {
|
|
76
|
-
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
77
|
-
try {
|
|
78
|
-
const randomSpy = __addDisposableResource(env_1, spyOn(Math, "random").mockReturnValue(0.9999999), false);
|
|
79
|
-
const min = 100;
|
|
80
|
-
const max = 110;
|
|
81
|
-
expect(Random.generate({ min, max })).toEqual(max);
|
|
82
|
-
randomSpy.mockReturnValue(0);
|
|
83
|
-
expect(Random.generate({ min, max })).toEqual(min);
|
|
84
|
-
}
|
|
85
|
-
catch (e_1) {
|
|
86
|
-
env_1.error = e_1;
|
|
87
|
-
env_1.hasError = true;
|
|
88
|
-
}
|
|
89
|
-
finally {
|
|
90
|
-
__disposeResources(env_1);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|