diff --git a/check-required-env/deno.jsonc b/check-required-env/deno.jsonc index 0ee7324..4267c8c 100644 --- a/check-required-env/deno.jsonc +++ b/check-required-env/deno.jsonc @@ -8,5 +8,8 @@ }, "imports": { "@frytg/logger": "jsr:@frytg/logger@0.0.2" + }, + "publish": { + "exclude": ["*.test.ts"] } } diff --git a/crypto/generate-default-keys.ts b/crypto/generate-default-keys.ts index 9d314da..2aa307e 100644 --- a/crypto/generate-default-keys.ts +++ b/crypto/generate-default-keys.ts @@ -1,11 +1,12 @@ /** - * @module * Run key generation for default key sizes and print the results to the console * * @example * ```bash * deno run jsr:@frytg/crypto/generate-default-keys * ``` + * + * @module */ // load module diff --git a/crypto/generate-key.ts b/crypto/generate-key.ts index 28e1357..e0fba5d 100644 --- a/crypto/generate-key.ts +++ b/crypto/generate-key.ts @@ -1,7 +1,5 @@ // deno-lint-ignore-file no-console /** - * @module - * * This module provides a function to generate a key of the specified number of bytes and print the key in base64 and hex to the console or return the key as a Buffer. * * @example @@ -10,6 +8,8 @@ * * generateKey(32, true) * ``` + * + * @module */ // load packages diff --git a/crypto/hash.ts b/crypto/hash.ts index e3b41c1..80fc6bb 100644 --- a/crypto/hash.ts +++ b/crypto/hash.ts @@ -1,13 +1,14 @@ /** - * @module * {@linkcode hashSha256 | SHA-256} and {@linkcode hashSha512 | SHA-512} hash functions * - * @example + * @example Hash SHA-256 * ```ts * import { hashSha512 } from '@frytg/crypto/hash' * * hashSha512('hello world') * ``` + * + * @module */ // load packages diff --git a/crypto/hmac.ts b/crypto/hmac.ts index 3408e44..734b007 100644 --- a/crypto/hmac.ts +++ b/crypto/hmac.ts @@ -1,13 +1,14 @@ /** - * @module * {@linkcode hmacSha256 | HMAC SHA-256} and {@linkcode hmacSha512 | HMAC SHA-512} hash functions * - * @example + * @example HMAC SHA-512 * ```ts * import { hmacSha512 } from '@frytg/crypto/hmac' * * hmacSha512('hello world', '0123456789abcdef') * ``` + * + * @module */ // load packages diff --git a/dates/CHANGELOG.md b/dates/CHANGELOG.md index e1e6583..02f342a 100644 --- a/dates/CHANGELOG.md +++ b/dates/CHANGELOG.md @@ -1,5 +1,11 @@ # Dates Changelog +## 2024-12-22 - 0.1.1 + +- fix: added `@deno-types` to `DateTime` import +- fix: removed `jsr:` prefix from ts examples +- fix: type errors for dates + ## 2024-12-12 - 0.1.0 - feat: added `formatDuration` function to format durations in milliseconds to a human readable string. diff --git a/dates/README.md b/dates/README.md index 5ab9c29..58135ae 100644 --- a/dates/README.md +++ b/dates/README.md @@ -5,6 +5,22 @@ This is a simple opinionated wrapper around the [Luxon](https://github.com/moment/luxon) library to provide pre-configured helpers. +For example, to get the current date in ISO format: + +```ts +import { getISO } from '@frytg/dates'; + +getISO(); // returns string like 2025-01-01T00:00:00.000Z +``` + +You can also use the full `DateTime` object from Luxon: + +```ts +import { DateTime } from '@frytg/dates'; + +const date = DateTime.fromMillis(1719859200000); +``` + ## Author Created by [@frytg](https://github.com/frytg) / [frytg.digital](https://www.frytg.digital) diff --git a/dates/dates.ts b/dates/dates.ts index 1f18bdb..8afe05f 100644 --- a/dates/dates.ts +++ b/dates/dates.ts @@ -1,12 +1,21 @@ // load package import { format as stdFormat } from '@std/fmt/duration' +// @deno-types="npm:@types/luxon@^3.4.2" import { DateTime } from 'luxon' const LOCAL_TIMEZONE = 'Europe/Amsterdam' const DATE_HOUR_MINUTES_FORMAT = 'ccc, d. LLLL yyyy - h:mma' /** - * Luxon DateTime + * Export DateTime from Luxon + * @returns {DateTime} DateTime + * + * @example + * ```ts + * import { DateTime } from '@frytg/dates' + * + * DateTime.fromMillis(1719859200000) + * ``` */ export { DateTime } @@ -17,7 +26,7 @@ export { DateTime } * * @example * ```ts - * import { toLocal } from 'jsr:@frytg/dates' + * import { toLocal } from '@frytg/dates' * * toLocal(getNow()) * ``` @@ -31,7 +40,7 @@ export const toLocal = (date: DateTime): DateTime => date.setZone(LOCAL_TIMEZONE * * @example * ```ts - * import { msToUnix } from 'jsr:@frytg/dates' + * import { msToUnix } from '@frytg/dates' * * msToUnix(getMs()) * ``` @@ -44,7 +53,7 @@ export const msToUnix = (ms: number): number => Number.parseInt(`${ms / 1000}`) * * @example * ```ts - * import { getNow } from 'jsr:@frytg/dates' + * import { getNow } from '@frytg/dates' * * getNow() * ``` @@ -52,49 +61,56 @@ export const msToUnix = (ms: number): number => Number.parseInt(`${ms / 1000}`) export const getNow = (): DateTime => DateTime.now() /** - * Provides util to get .unix() style value + * Get unix timestamp * @param {DateTime} [date] - date object * @returns {number} unix timestamp * * @example * ```ts - * import { getUnix } from 'jsr:@frytg/dates' + * import { getUnix } from '@frytg/dates' * * getUnix() * getUnix(getNow()) * ``` */ -export const getUnix = (date?: DateTime): number => msToUnix((date || getNow()).valueOf()) +export const getUnix = (date?: DateTime): number => msToUnix(getDateTime(date).valueOf()) /** - * Provides util to get ms timestamp + * Get ms (milliseconds) timestamp * @param {DateTime} [date] - date object * @returns {number} ms timestamp * * @example * ```ts - * import { getMs } from 'jsr:@frytg/dates' + * import { getMs } from '@frytg/dates' * * getMs() * getMs(getNow()) * ``` */ -export const getMs = (date?: DateTime): number => (date || getNow()).valueOf() +export const getMs = (date?: DateTime): number => getDateTime(date).valueOf() + +/** + * Internal util to get DateTime object + * @param {DateTime} [date] - date object + * @returns {DateTime} DateTime object + */ +const getDateTime = (date?: DateTime): DateTime => (date instanceof DateTime ? date : getNow()) /** - * Provides util to get ISO string in UTC timezone + * Get ISO string in UTC timezone * @param {DateTime} [date] - date object * @returns {string} ISO string * * @example * ```ts - * import { getISO } from 'jsr:@frytg/dates' + * import { getISO } from '@frytg/dates' * * getISO() * getISO(getNow()) * ``` */ -export const getISO = (date?: DateTime): string => (date || getNow()).toUTC().toISO() +export const getISO = (date?: DateTime): string | null => getDateTime(date).toUTC().toISO() /** * Get ISO string (alias for {@link getISO}) @@ -110,7 +126,7 @@ export const getIso = getISO * * @example * ```ts - * import { getMsOffset } from 'jsr:@frytg/dates' + * import { getMsOffset } from '@frytg/dates' * * getMsOffset(getMs()) * ``` @@ -125,13 +141,13 @@ export const getMsOffset = (ms: number): number => getMs() - ms * * @example * ```ts - * import { getRelative } from 'jsr:@frytg/dates' + * import { getRelative } from '@frytg/dates' * * getRelative(getNow()) * getRelative(getNow(), 'nl-NL') * ``` */ -export const getRelative = (date: DateTime, locale = 'en-US'): string => date.toRelative({ locale }) +export const getRelative = (date: DateTime, locale = 'en-US'): string | null => date.toRelative({ locale }) /** * Get year-month-day (YYYYMMDD or YYYY-MM-DD) @@ -141,14 +157,14 @@ export const getRelative = (date: DateTime, locale = 'en-US'): string => date.to * * @example * ```ts - * import { getYearMonthDay } from 'jsr:@frytg/dates' + * import { getYearMonthDay } from '@frytg/dates' * * getYearMonthDay(getNow()) // YYYYMMDD * getYearMonthDay(getNow(), true) // YYYY-MM-DD * ``` */ export const getYearMonthDay = (date?: DateTime, withDashes = false): string | number => - withDashes ? (date || getNow()).toFormat('yyyy-LL-dd') : Number.parseInt((date || getNow()).toFormat('yyyyLLdd')) + withDashes ? getDateTime(date).toFormat('yyyy-LL-dd') : Number.parseInt(getDateTime(date).toFormat('yyyyLLdd')) /** * Parse ISO string @@ -157,7 +173,7 @@ export const getYearMonthDay = (date?: DateTime, withDashes = false): string | n * * @example * ```ts - * import { parseISO } from 'jsr:@frytg/dates' + * import { parseISO } from '@frytg/dates' * * parseISO(getISO()) * parseISO('2024-11-23T10:00:00.000Z') @@ -179,7 +195,7 @@ export const parseIso = parseISO * * @example * ```ts - * import { getDateHourMinutes } from 'jsr:@frytg/dates' + * import { getDateHourMinutes } from '@frytg/dates' * * getDateHourMinutes(getNow()) * ``` @@ -194,7 +210,7 @@ export const getDateHourMinutes = (date: DateTime): string => * * @example * ```ts - * import { getFullRelativeTime } from 'jsr:@frytg/dates' + * import { getFullRelativeTime } from '@frytg/dates' * * getFullRelativeTime(getNow()) * ``` @@ -209,7 +225,7 @@ export const getFullRelativeTime = (date: DateTime): string => `${getDateHourMin * * @example * ```ts - * import { formatDuration } from 'jsr:@frytg/dates' + * import { formatDuration } from '@frytg/dates' * * formatDuration(1000) // 1s * diff --git a/dates/deno.jsonc b/dates/deno.jsonc index 220e5b4..1b301ce 100644 --- a/dates/deno.jsonc +++ b/dates/deno.jsonc @@ -1,10 +1,11 @@ { "$schema": "https://jsr.io/schema/config-file.v1.json", "name": "@frytg/dates", - "version": "0.1.0", + "version": "0.1.1", "exports": "./dates.ts", "imports": { "@std/fmt": "jsr:@std/fmt@^1.0.3", + "@types/luxon": "npm:@types/luxon@^3.4.2", "luxon": "npm:luxon@^3.5.0" }, "publish": { diff --git a/deno.jsonc b/deno.jsonc index 741f0a8..4afb0b8 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -36,7 +36,7 @@ "@biomejs/biome": "npm:@biomejs/biome@^1.9.4", "@types/node": "npm:@types/node@^22.10.2", "@cross/test": "jsr:@cross/test@^0.0.10", - "@std/assert": "jsr:@std/assert@^1.0.9", + "@std/assert": "jsr:@std/assert@^1.0.10", "sinon": "npm:sinon@^19.0.2" } } diff --git a/deno.lock b/deno.lock index 22a4a20..36e9573 100644 --- a/deno.lock +++ b/deno.lock @@ -4,15 +4,17 @@ "jsr:@cross/runtime@1": "1.1.0", "jsr:@cross/test@^0.0.10": "0.0.10", "jsr:@frytg/logger@0.0.2": "0.0.2", - "jsr:@std/assert@^1.0.9": "1.0.9", + "jsr:@std/assert@^1.0.10": "1.0.10", "jsr:@std/fmt@^1.0.3": "1.0.3", "jsr:@std/internal@^1.0.5": "1.0.5", "npm:@biomejs/biome@1.9.4": "1.9.4", "npm:@biomejs/biome@^1.9.4": "1.9.4", + "npm:@types/luxon@*": "3.4.2", + "npm:@types/luxon@^3.4.2": "3.4.2", "npm:@types/node@*": "22.5.4", "npm:@types/node@^22.10.2": "22.10.2", "npm:luxon@^3.5.0": "3.5.0", - "npm:minio@^8.0.2": "8.0.2", + "npm:minio@^8.0.3": "8.0.3", "npm:sinon@^19.0.2": "19.0.2", "npm:winston@^3.17.0": "3.17.0" }, @@ -32,8 +34,8 @@ "npm:winston" ] }, - "@std/assert@1.0.9": { - "integrity": "a9f0c611a869cc791b26f523eec54c7e187aab7932c2c8e8bea0622d13680dcd", + "@std/assert@1.0.10": { + "integrity": "59b5cbac5bd55459a19045d95cc7c2ff787b4f8527c0dd195078ff6f9481fbb3", "dependencies": [ "jsr:@std/internal" ] @@ -117,6 +119,9 @@ "@sinonjs/text-encoding@0.7.3": { "integrity": "sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA==" }, + "@types/luxon@3.4.2": { + "integrity": "sha512-TifLZlFudklWlMBfhubvgqTXRzLDI5pCbGa4P8a3wPyUQSW+1xQ5eDsreP9DWHX3tjq1ke96uYG/nwundroWcA==" + }, "@types/node@22.10.2": { "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", "dependencies": [ @@ -156,16 +161,29 @@ "buffer-crc32@1.0.0": { "integrity": "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==" }, - "call-bind@1.0.7": { - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "call-bind-apply-helpers@1.0.1": { + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", "dependencies": [ - "es-define-property", "es-errors", - "function-bind", + "function-bind" + ] + }, + "call-bind@1.0.8": { + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dependencies": [ + "call-bind-apply-helpers", + "es-define-property", "get-intrinsic", "set-function-length" ] }, + "call-bound@1.0.3": { + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "dependencies": [ + "call-bind-apply-helpers", + "get-intrinsic" + ] + }, "color-convert@1.9.3": { "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dependencies": [ @@ -210,23 +228,34 @@ "diff@7.0.0": { "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==" }, + "dunder-proto@1.0.1": { + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dependencies": [ + "call-bind-apply-helpers", + "es-errors", + "gopd" + ] + }, "enabled@2.0.0": { "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==" }, - "es-define-property@1.0.0": { - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dependencies": [ - "get-intrinsic" - ] + "es-define-property@1.0.1": { + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==" }, "es-errors@1.3.0": { "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" }, + "es-object-atoms@1.0.0": { + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dependencies": [ + "es-errors" + ] + }, "eventemitter3@5.0.1": { "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" }, - "fast-xml-parser@4.5.0": { - "integrity": "sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==", + "fast-xml-parser@4.5.1": { + "integrity": "sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w==", "dependencies": [ "strnum" ] @@ -249,21 +278,23 @@ "function-bind@1.1.2": { "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, - "get-intrinsic@1.2.4": { - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "get-intrinsic@1.2.6": { + "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", "dependencies": [ + "call-bind-apply-helpers", + "dunder-proto", + "es-define-property", "es-errors", + "es-object-atoms", "function-bind", - "has-proto", + "gopd", "has-symbols", - "hasown" + "hasown", + "math-intrinsics" ] }, - "gopd@1.0.1": { - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dependencies": [ - "get-intrinsic" - ] + "gopd@1.2.0": { + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" }, "has-flag@4.0.0": { "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" @@ -274,11 +305,8 @@ "es-define-property" ] }, - "has-proto@1.0.3": { - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" - }, - "has-symbols@1.0.3": { - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + "has-symbols@1.1.0": { + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" }, "has-tostringtag@1.0.2": { "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", @@ -298,10 +326,10 @@ "ipaddr.js@2.2.0": { "integrity": "sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==" }, - "is-arguments@1.1.1": { - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "is-arguments@1.2.0": { + "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", "dependencies": [ - "call-bind", + "call-bound", "has-tostringtag" ] }, @@ -320,8 +348,8 @@ "is-stream@2.0.1": { "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" }, - "is-typed-array@1.1.13": { - "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "is-typed-array@1.1.15": { + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", "dependencies": [ "which-typed-array" ] @@ -352,6 +380,9 @@ "luxon@3.5.0": { "integrity": "sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==" }, + "math-intrinsics@1.1.0": { + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==" + }, "mime-db@1.52.0": { "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" }, @@ -361,8 +392,8 @@ "mime-db" ] }, - "minio@8.0.2": { - "integrity": "sha512-7ipWbtgzzboctf+McK+2cXwCrNOhuboTA/O1g9iWa0gH8R4GkeyFWwk12aVDEHdzjPiG8wxnjwfHS7pgraKuHw==", + "minio@8.0.3": { + "integrity": "sha512-+FIYQ+HZ5GrBjEmIYienRgEikqaTWAflXIV5lJOtUzfYxn3NvjQx7BsJSORXExlqgzWxKTWsqkyk2wiyFjs9/w==", "dependencies": [ "async", "block-stream2", @@ -536,11 +567,12 @@ "util" ] }, - "which-typed-array@1.1.15": { - "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "which-typed-array@1.1.18": { + "integrity": "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==", "dependencies": [ "available-typed-arrays", "call-bind", + "call-bound", "for-each", "gopd", "has-tostringtag" @@ -641,7 +673,7 @@ "workspace": { "dependencies": [ "jsr:@cross/test@^0.0.10", - "jsr:@std/assert@^1.0.9", + "jsr:@std/assert@^1.0.10", "npm:@biomejs/biome@^1.9.4", "npm:@types/node@^22.10.2", "npm:sinon@^19.0.2" @@ -655,6 +687,7 @@ "dates": { "dependencies": [ "jsr:@std/fmt@^1.0.3", + "npm:@types/luxon@^3.4.2", "npm:luxon@^3.5.0" ] }, @@ -665,7 +698,7 @@ }, "storage-s3": { "dependencies": [ - "npm:minio@^8.0.2" + "npm:minio@^8.0.3" ] } } diff --git a/logger/deno.jsonc b/logger/deno.jsonc index bd35d5c..04ea039 100644 --- a/logger/deno.jsonc +++ b/logger/deno.jsonc @@ -5,5 +5,8 @@ "exports": "./logger.ts", "imports": { "winston": "npm:winston@^3.17.0" + }, + "publish": { + "exclude": ["*.test.ts"] } } diff --git a/logger/logger.ts b/logger/logger.ts index 7c4bffc..f597280 100644 --- a/logger/logger.ts +++ b/logger/logger.ts @@ -1,6 +1,7 @@ /** - * @module * A pre-configured logger that is ready to use with syslog levels. + * + * @module */ // load packages diff --git a/storage-s3/README.md b/storage-s3/README.md index c940021..045659f 100644 --- a/storage-s3/README.md +++ b/storage-s3/README.md @@ -13,7 +13,11 @@ import { getObject } from '@frytg/storage-s3'; const object = await getObject('path/to/object.json', { parseJson: true }); ``` -The MinIO client will be initialized with the required environment variables `STORE_S3_ENDPOINT`, `STORE_S3_ACCESS_KEY`, and `STORE_S3_SECRET_KEY`. +The MinIO client will be initialized with these required environment variables: + +- `STORE_S3_ENDPOINT` +- `STORE_S3_ACCESS_KEY` +- `STORE_S3_SECRET_KEY` ## Methods @@ -22,7 +26,8 @@ The MinIO client will be initialized with the required environment variables `ST - [objectExists](https://jsr.io/@frytg/storage-s3/doc/~/objectExists) - [listObjects](https://jsr.io/@frytg/storage-s3/doc/~/listObjects) -Also see all options in the [MinIO API documentation](https://min.io/docs/minio/linux/developers/javascript/API.html). They can be used by importing the `Client` object. +Also see all options in the [MinIO API documentation](https://min.io/docs/minio/linux/developers/javascript/API.html). +They can be used by importing the `Client` object. ## Author diff --git a/storage-s3/deno.jsonc b/storage-s3/deno.jsonc index edcb67e..c83696d 100644 --- a/storage-s3/deno.jsonc +++ b/storage-s3/deno.jsonc @@ -4,6 +4,9 @@ "version": "0.0.1", "exports": "./storage.ts", "imports": { - "minio": "npm:minio@^8.0.2" + "minio": "npm:minio@^8.0.3" + }, + "publish": { + "exclude": ["*.test.ts"] } } diff --git a/storage-s3/storage.ts b/storage-s3/storage.ts index 269399d..98f73c3 100644 --- a/storage-s3/storage.ts +++ b/storage-s3/storage.ts @@ -2,8 +2,6 @@ * Storage module for S3 with common operations using MinIO. * * @module - * - * @see https://min.io/docs/minio/linux/developers/javascript/API.html */ // import packages