Compare commits

..

7 commits

Author SHA1 Message Date
318a249b29 Update dependency @typescript-eslint/parser to v8.11.0
All checks were successful
Test / build (push) Successful in 11s
2024-10-28 00:08:51 +00:00
4b9c8a8ea5 Add "Gallery" field to return multiple images in 1 post (#242)
All checks were successful
Stage / build (push) Successful in 8s
Stage / rsync (push) Successful in 6s
# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

- Added a `Gallery` option to the return parameters, which will be an array of image links for every image of that post
- The JSON will always show it
- The human readable will only show it if there is more than 1 image

#161

## Type of change

Please delete options that are not relevant.

- [x] New feature (non-breaking change which adds functionality)
- [x] This change requires a documentation update

# How Has This Been Tested?

Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration.

- Added new unit tests for these changes

# Checklist

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that provide my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules

Reviewed-on: #242
Reviewed-by: VylpesTester <tester@vylpes.com>
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
2024-10-26 22:00:55 +01:00
db35dee5f9 Revert "Update dependency @yao-pkg/pkg to v5.16.0 (#232)"
All checks were successful
Stage / build (push) Successful in 8s
Stage / rsync (push) Successful in 5s
This reverts commit ec2b5f1fc7.
2024-10-21 17:38:34 +01:00
ef1651f871 Update dependency @types/node to v22.7.7 (#238)
Some checks failed
Stage / build (push) Successful in 8s
Stage / rsync (push) Failing after 5s
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)) | devDependencies | minor | [`22.5.5` -> `22.7.7`](https://renovatebot.com/diffs/npm/@types%2fnode/22.5.5/22.7.7) |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AiLCJsYWJlbHMiOlsidHlwZS9kZXBlbmRlbmNpZXMiXX0=-->

Reviewed-on: #238
Reviewed-by: Vylpes <ethan@vylpes.com>
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
2024-10-21 17:36:45 +01:00
ec2b5f1fc7 Update dependency @yao-pkg/pkg to v5.16.0 (#232)
Some checks failed
Stage / build (push) Successful in 9s
Stage / rsync (push) Failing after 6s
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@yao-pkg/pkg](https://github.com/yao-pkg/pkg) | devDependencies | minor | [`5.13.0` -> `5.16.0`](https://renovatebot.com/diffs/npm/@yao-pkg%2fpkg/5.13.0/5.16.0) |

---

### Release Notes

<details>
<summary>yao-pkg/pkg (@&#8203;yao-pkg/pkg)</summary>

### [`v5.16.0`](https://github.com/yao-pkg/pkg/blob/HEAD/CHANGELOG.md#5160-2024-10-20)

[Compare Source](https://github.com/yao-pkg/pkg/compare/v5.15.0...v5.16.0)

##### Features

-   bump fetch with node 22.10.0 and 20.18.0 support ([86d5f57](86d5f5797a))

##### Code refactoring

-   remove `fs-extra` ([#&#8203;102](https://github.com/yao-pkg/pkg/issues/102)) ([c726221](c726221de3))
-   replace `chalk` with `picocolors` ([#&#8203;105](https://github.com/yao-pkg/pkg/issues/105)) ([cba291e](cba291e246))
-   replace `globby` with `tinyglobby` ([#&#8203;103](https://github.com/yao-pkg/pkg/issues/103)) ([99a2632](99a26329cb))
-   replace `minimatch` with `picomatch` ([#&#8203;104](https://github.com/yao-pkg/pkg/issues/104)) ([1838100](183810066d))

##### Chores

-   unpin dependencies ([#&#8203;106](https://github.com/yao-pkg/pkg/issues/106)) ([ea94b03](ea94b03bad))

##### Documentation

-   explain how to execute binary from snapshot ([db7f2c5](db7f2c5ede))
-   explain how to use custom binaries ([18ed3cf](18ed3cfd1e))

### [`v5.15.0`](https://github.com/yao-pkg/pkg/blob/HEAD/CHANGELOG.md#5150-2024-09-20)

[Compare Source](https://github.com/yao-pkg/pkg/compare/v5.14.2...v5.15.0)

##### Features

-   bump [@&#8203;yao-pkg/pkg-fetch](https://github.com/yao-pkg/pkg-fetch)[@&#8203;3](https://github.com/3).5.13 with nodejs 22.9.0 ([#&#8203;91](https://github.com/yao-pkg/pkg/issues/91)) ([6ed5665](6ed566564f))

### [`v5.14.2`](https://github.com/yao-pkg/pkg/blob/HEAD/CHANGELOG.md#5142-2024-09-17)

[Compare Source](https://github.com/yao-pkg/pkg/compare/v5.14.1...v5.14.2)

##### Bug Fixes

-   child_process commands throw when pkg app try to call itself ([#&#8203;90](https://github.com/yao-pkg/pkg/issues/90)) ([e88d159](e88d15919f))

### [`v5.14.1`](https://github.com/yao-pkg/pkg/blob/HEAD/CHANGELOG.md#5141-2024-09-17)

[Compare Source](https://github.com/yao-pkg/pkg/compare/v5.14.0...v5.14.1)

##### Bug Fixes

-   bump pkg-fetch@3.5.12 with missing node22 macOS arm64 support ([4eea80c](4eea80c26d))

### [`v5.14.0`](https://github.com/yao-pkg/pkg/blob/HEAD/CHANGELOG.md#5140-2024-09-10)

[Compare Source](https://github.com/yao-pkg/pkg/compare/v5.13.0...v5.14.0)

##### Features

-   bump pkg-fetch@3.5.11 with nodejs 22 support (by [@&#8203;faulpeltz](https://github.com/faulpeltz)) ([1d8df70](1d8df70e21))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AiLCJsYWJlbHMiOlsidHlwZS9kZXBlbmRlbmNpZXMiXX0=-->

Reviewed-on: #232
Reviewed-by: Vylpes <ethan@vylpes.com>
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
2024-10-21 17:33:31 +01:00
dc24fe82a8 Update dependency @eslint/js to v9.13.0 (#231)
All checks were successful
Stage / build (push) Successful in 8s
Stage / rsync (push) Successful in 5s
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@eslint/js](https://eslint.org) ([source](https://github.com/eslint/eslint/tree/HEAD/packages/js)) | devDependencies | minor | [`9.10.0` -> `9.13.0`](https://renovatebot.com/diffs/npm/@eslint%2fjs/9.10.0/9.13.0) |

---

### Release Notes

<details>
<summary>eslint/eslint (@&#8203;eslint/js)</summary>

### [`v9.13.0`](https://github.com/eslint/eslint/releases/tag/v9.13.0)

[Compare Source](https://github.com/eslint/eslint/compare/v9.12.0...v9.13.0)

#### Features

-   [`381c32b`](381c32b697) feat: Allow languages to provide `defaultLanguageOptions` ([#&#8203;19003](https://github.com/eslint/eslint/issues/19003)) (Milos Djermanovic)
-   [`bf723bd`](bf723bd0f9) feat: Improve eslintrc warning message ([#&#8203;19023](https://github.com/eslint/eslint/issues/19023)) (Milos Djermanovic)
-   [`1def4cd`](1def4cdfab) feat: drop support for jiti v1.21 ([#&#8203;18996](https://github.com/eslint/eslint/issues/18996)) (Francesco Trotta)
-   [`f879be2`](f879be240c) feat: export `ESLint.defaultConfig` ([#&#8203;18983](https://github.com/eslint/eslint/issues/18983)) (Nitin Kumar)

#### Bug Fixes

-   [`78836d4`](78836d40eb) fix: update the `complexity` rule type ([#&#8203;19027](https://github.com/eslint/eslint/issues/19027)) (Nitin Kumar)
-   [`064c8b6`](064c8b612e) fix: update rule types ([#&#8203;18925](https://github.com/eslint/eslint/issues/18925)) (Nitin Kumar)

#### Documentation

-   [`abdbfa8`](abdbfa8390) docs: mark `LintMessage#nodeType` as deprecated ([#&#8203;19019](https://github.com/eslint/eslint/issues/19019)) (Nitin Kumar)
-   [`19e68d3`](19e68d3f3a) docs: update deprecated rules type definitions ([#&#8203;19018](https://github.com/eslint/eslint/issues/19018)) (Nitin Kumar)
-   [`7dd402d`](7dd402d332) docs: Update examples of passing multiple values to a CLI option ([#&#8203;19006](https://github.com/eslint/eslint/issues/19006)) (Milos Djermanovic)
-   [`5dcbc51`](5dcbc519b7) docs: Add example with side-effect imports to no-restricted-imports ([#&#8203;18997](https://github.com/eslint/eslint/issues/18997)) (Milos Djermanovic)
-   [`1ee87ca`](1ee87ca1c5) docs: Update README (GitHub Actions Bot)
-   [`2c3dbdc`](2c3dbdc231) docs: Use prerendered sponsors for README ([#&#8203;18988](https://github.com/eslint/eslint/issues/18988)) (Milos Djermanovic)

#### Chores

-   [`68d2d9d`](68d2d9dfd6) chore: upgrade to `@eslint/js@9.13.0` and `@eslint/core@^0.7.0` ([#&#8203;19034](https://github.com/eslint/eslint/issues/19034)) (Francesco Trotta)
-   [`2211f0a`](2211f0aeb3) chore: package.json update for [@&#8203;eslint/js](https://github.com/eslint/js) release (Jenkins)
-   [`c7abaef`](c7abaef533) perf: using Node.js compile cache ([#&#8203;19012](https://github.com/eslint/eslint/issues/19012)) (唯然)
-   [`1d7c077`](1d7c077145) chore: add pkg.type "commonjs" ([#&#8203;19011](https://github.com/eslint/eslint/issues/19011)) (唯然)
-   [`468e3bd`](468e3bdadf) test: fix `ESLint` tests ([#&#8203;19021](https://github.com/eslint/eslint/issues/19021)) (Francesco Trotta)
-   [`ed4635f`](ed4635fa0e) ci: upgrade knip@5.32.0 ([#&#8203;18992](https://github.com/eslint/eslint/issues/18992)) (Milos Djermanovic)
-   [`efad767`](efad767321) chore: remove unused ignore dependency ([#&#8203;18993](https://github.com/eslint/eslint/issues/18993)) (Amaresh  S M)

### [`v9.12.0`](https://github.com/eslint/eslint/releases/tag/v9.12.0)

[Compare Source](https://github.com/eslint/eslint/compare/v9.11.1...v9.12.0)

#### Features

-   [`5a6a053`](5a6a05321c) feat: update to `jiti` v2 ([#&#8203;18954](https://github.com/eslint/eslint/issues/18954)) (Arya Emami)
-   [`17a07fb`](17a07fb548) feat: Hooks for test cases (RuleTester) ([#&#8203;18771](https://github.com/eslint/eslint/issues/18771)) (Anna Bocharova)
-   [`2ff0e51`](2ff0e51ced) feat: Implement alternate config lookup ([#&#8203;18742](https://github.com/eslint/eslint/issues/18742)) (Nicholas C. Zakas)
-   [`2d17453`](2d174532ae) feat: Implement modified cyclomatic complexity ([#&#8203;18896](https://github.com/eslint/eslint/issues/18896)) (Dmitry Pashkevich)

#### Bug Fixes

-   [`ea380ca`](ea380cac6f) fix: Upgrade retry to avoid EMFILE errors ([#&#8203;18986](https://github.com/eslint/eslint/issues/18986)) (Nicholas C. Zakas)
-   [`fdd6319`](fdd631964a) fix: Issues with type definitions ([#&#8203;18940](https://github.com/eslint/eslint/issues/18940)) (Arya Emami)

#### Documentation

-   [`ecbd522`](ecbd52291d) docs: Mention code explorer ([#&#8203;18978](https://github.com/eslint/eslint/issues/18978)) (Nicholas C. Zakas)
-   [`7ea4ecc`](7ea4ecc6e3) docs: Clarifying the Use of Meta Objects ([#&#8203;18697](https://github.com/eslint/eslint/issues/18697)) (Amaresh  S M)
-   [`d3e4b2e`](d3e4b2ea4a) docs: Clarify how to exclude `.js` files ([#&#8203;18976](https://github.com/eslint/eslint/issues/18976)) (Milos Djermanovic)
-   [`57232ff`](57232ff3d5) docs: Mention plugin-kit in language docs ([#&#8203;18973](https://github.com/eslint/eslint/issues/18973)) (Nicholas C. Zakas)
-   [`b80ed00`](b80ed007ce) docs: Update README (GitHub Actions Bot)
-   [`cb69ab3`](cb69ab374c) docs: Update README (GitHub Actions Bot)
-   [`7fb0d95`](7fb0d957c1) docs: Update README (GitHub Actions Bot)
-   [`493348a`](493348a9a5) docs: Update README (GitHub Actions Bot)
-   [`87a582c`](87a582c8b5) docs: fix typo in `id-match` rule ([#&#8203;18944](https://github.com/eslint/eslint/issues/18944)) (Jay)

#### Chores

-   [`555aafd`](555aafd06f) chore: upgrade to `@eslint/js@9.12.0` ([#&#8203;18987](https://github.com/eslint/eslint/issues/18987)) (Francesco Trotta)
-   [`873ae60`](873ae608c1) chore: package.json update for [@&#8203;eslint/js](https://github.com/eslint/js) release (Jenkins)
-   [`d0a5414`](d0a5414c30) refactor: replace strip-ansi with native module ([#&#8203;18982](https://github.com/eslint/eslint/issues/18982)) (Cristopher)
-   [`b827029`](b8270299ab) chore: Enable JSON5 linting ([#&#8203;18979](https://github.com/eslint/eslint/issues/18979)) (Milos Djermanovic)
-   [`8f55ca2`](8f55ca22d9) chore: Upgrade espree, eslint-visitor-keys, eslint-scope ([#&#8203;18962](https://github.com/eslint/eslint/issues/18962)) (Nicholas C. Zakas)
-   [`c1a2725`](c1a2725e9c) chore: update dependency mocha to ^10.7.3 ([#&#8203;18945](https://github.com/eslint/eslint/issues/18945)) (Milos Djermanovic)

### [`v9.11.1`](https://github.com/eslint/eslint/releases/tag/v9.11.1)

[Compare Source](https://github.com/eslint/eslint/compare/v9.11.0...v9.11.1)

#### Bug Fixes

-   [`20fd916`](20fd91689f) fix: add `@eslint/core`, `@types/estree`, & `@types/json-schema` deps ([#&#8203;18938](https://github.com/eslint/eslint/issues/18938)) (Nitin Kumar)
-   [`2738322`](27383226b8) fix: add missing types for `require-atomic-updates` rule ([#&#8203;18937](https://github.com/eslint/eslint/issues/18937)) (Kristóf Poduszló)
-   [`d71ff30`](d71ff3068c) fix: add missing types for `object-shorthand` rule ([#&#8203;18935](https://github.com/eslint/eslint/issues/18935)) (Kristóf Poduszló)
-   [`561cadc`](561cadc543) fix: add missing types for `no-unsafe-negation` rule ([#&#8203;18932](https://github.com/eslint/eslint/issues/18932)) (Kristóf Poduszló)
-   [`8843656`](8843656f9b) fix: add missing types for `no-underscore-dangle` rule ([#&#8203;18931](https://github.com/eslint/eslint/issues/18931)) (Kristóf Poduszló)
-   [`92cde5c`](92cde5c6da) fix: add missing types for `no-shadow` rule ([#&#8203;18930](https://github.com/eslint/eslint/issues/18930)) (Kristóf Poduszló)
-   [`b3cbe11`](b3cbe11a92) fix: add missing types for `no-sequences` rule ([#&#8203;18929](https://github.com/eslint/eslint/issues/18929)) (Kristóf Poduszló)
-   [`976f77f`](976f77f7f6) fix: add missing types for `no-unused-expressions` rule ([#&#8203;18933](https://github.com/eslint/eslint/issues/18933)) (Kristóf Poduszló)

#### Documentation

-   [`3eff709`](3eff709637) docs: replace deprecated `Linter.FlatConfig` type with `Linter.Config` ([#&#8203;18941](https://github.com/eslint/eslint/issues/18941)) (Carlos Meira)

#### Chores

-   [`df4a859`](df4a859b4c) chore: upgrade [@&#8203;eslint/js](https://github.com/eslint/js)[@&#8203;9](https://github.com/9).11.1 ([#&#8203;18943](https://github.com/eslint/eslint/issues/18943)) (Milos Djermanovic)
-   [`36d8095`](36d8095308) chore: package.json update for [@&#8203;eslint/js](https://github.com/eslint/js) release (Jenkins)

### [`v9.11.0`](https://github.com/eslint/eslint/releases/tag/v9.11.0)

[Compare Source](https://github.com/eslint/eslint/compare/v9.10.0...v9.11.0)

#### Features

-   [`ec30c73`](ec30c7349e) feat: add "eslint/universal" to export `Linter` ([#&#8203;18883](https://github.com/eslint/eslint/issues/18883)) (唯然)
-   [`c591da6`](c591da68d4) feat: Add language to types ([#&#8203;18917](https://github.com/eslint/eslint/issues/18917)) (Nicholas C. Zakas)
-   [`492eb8f`](492eb8f34e) feat: limit the name given to `ImportSpecifier` in `id-length` ([#&#8203;18861](https://github.com/eslint/eslint/issues/18861)) (Tanuj Kanti)
-   [`19c6856`](19c685608d) feat: Add `no-useless-constructor` suggestion ([#&#8203;18799](https://github.com/eslint/eslint/issues/18799)) (Jordan Thomson)
-   [`a48f8c2`](a48f8c29b5) feat: add type `FormatterFunction`, update `LoadedFormatter` ([#&#8203;18872](https://github.com/eslint/eslint/issues/18872)) (Francesco Trotta)

#### Bug Fixes

-   [`5e5f39b`](5e5f39b825) fix: add missing types for `no-restricted-exports` rule ([#&#8203;18914](https://github.com/eslint/eslint/issues/18914)) (Kristóf Poduszló)
-   [`8f630eb`](8f630eb579) fix: add missing types for `no-param-reassign` options ([#&#8203;18906](https://github.com/eslint/eslint/issues/18906)) (Kristóf Poduszló)
-   [`d715781`](d71578124f) fix: add missing types for `no-extra-boolean-cast` options ([#&#8203;18902](https://github.com/eslint/eslint/issues/18902)) (Kristóf Poduszló)
-   [`2de5742`](2de5742682) fix: add missing types for `no-misleading-character-class` options ([#&#8203;18905](https://github.com/eslint/eslint/issues/18905)) (Kristóf Poduszló)
-   [`c153084`](c153084250) fix: add missing types for `no-implicit-coercion` options ([#&#8203;18903](https://github.com/eslint/eslint/issues/18903)) (Kristóf Poduszló)
-   [`fa11b2e`](fa11b2ede6) fix: add missing types for `no-empty-function` options ([#&#8203;18901](https://github.com/eslint/eslint/issues/18901)) (Kristóf Poduszló)
-   [`a0deed1`](a0deed122a) fix: add missing types for `camelcase` options ([#&#8203;18897](https://github.com/eslint/eslint/issues/18897)) (Kristóf Poduszló)

#### Documentation

-   [`e4e5709`](e4e5709522) docs: correct `prefer-object-has-own` type definition comment ([#&#8203;18924](https://github.com/eslint/eslint/issues/18924)) (Nitin Kumar)
-   [`91cbd18`](91cbd18c70) docs: add unicode abbreviations in no-irregular-whitespace rule ([#&#8203;18894](https://github.com/eslint/eslint/issues/18894)) (Alix Royere)
-   [`59cfc0f`](59cfc0f1b3) docs: clarify `resultsMeta` in `LoadedFormatter` type ([#&#8203;18881](https://github.com/eslint/eslint/issues/18881)) (Milos Djermanovic)
-   [`adcc50d`](adcc50dbf1) docs: Update README (GitHub Actions Bot)
-   [`4edac1a`](4edac1a325) docs: Update README (GitHub Actions Bot)

#### Build Related

-   [`959d360`](959d360be5) build: Support updates to previous major versions ([#&#8203;18871](https://github.com/eslint/eslint/issues/18871)) (Milos Djermanovic)

#### Chores

-   [`ca21a64`](ca21a64ed0) chore: upgrade [@&#8203;eslint/js](https://github.com/eslint/js)[@&#8203;9](https://github.com/9).11.0 ([#&#8203;18927](https://github.com/eslint/eslint/issues/18927)) (Milos Djermanovic)
-   [`a10f90a`](a10f90af35) chore: package.json update for [@&#8203;eslint/js](https://github.com/eslint/js) release (Jenkins)
-   [`e4e02cc`](e4e02cc693) refactor: Extract processor logic into ProcessorService ([#&#8203;18818](https://github.com/eslint/eslint/issues/18818)) (Nicholas C. Zakas)
-   [`6d4484d`](6d4484d9c1) chore: updates for v8.57.1 release (Jenkins)
-   [`71f37c5`](71f37c5bf0) refactor: use optional chaining when validating config rules ([#&#8203;18893](https://github.com/eslint/eslint/issues/18893)) (lucasrmendonca)
-   [`2c2805f`](2c2805f8ee) chore: Add PR note to all templates ([#&#8203;18892](https://github.com/eslint/eslint/issues/18892)) (Nicholas C. Zakas)
-   [`7b852ce`](7b852ce59e) refactor: use `Directive` class from `@eslint/plugin-kit` ([#&#8203;18884](https://github.com/eslint/eslint/issues/18884)) (Milos Djermanovic)
-   [`d594ddd`](d594ddd2cc) chore: update dependency [@&#8203;eslint/core](https://github.com/eslint/core) to ^0.6.0 ([#&#8203;18863](https://github.com/eslint/eslint/issues/18863)) (renovate\[bot])
-   [`78b2421`](78b2421e28) chore: Update change.yml ([#&#8203;18882](https://github.com/eslint/eslint/issues/18882)) (Nicholas C. Zakas)
-   [`a416f0a`](a416f0a270) chore: enable `$ExpectType` comments in .ts files ([#&#8203;18869](https://github.com/eslint/eslint/issues/18869)) (Francesco Trotta)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AiLCJsYWJlbHMiOlsidHlwZS9kZXBlbmRlbmNpZXMiXX0=-->

Reviewed-on: #231
Reviewed-by: Vylpes <ethan@vylpes.com>
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
2024-10-21 17:32:41 +01:00
5649bb83d7 Update dependency @typescript-eslint/eslint-plugin to v8.10.0 (#230)
All checks were successful
Stage / build (push) Successful in 9s
Stage / rsync (push) Successful in 6s
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@typescript-eslint/eslint-plugin](https://typescript-eslint.io/packages/eslint-plugin) ([source](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin)) | devDependencies | minor | [`8.2.0` -> `8.10.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2feslint-plugin/8.2.0/8.10.0) |

---

### Release Notes

<details>
<summary>typescript-eslint/typescript-eslint (@&#8203;typescript-eslint/eslint-plugin)</summary>

### [`v8.10.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8100-2024-10-17)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v8.9.0...v8.10.0)

##### 🚀 Features

-   support TypeScript 5.6 ([#&#8203;9972](https://github.com/typescript-eslint/typescript-eslint/pull/9972))

##### ❤️  Thank You

-   Josh Goldberg 

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v8.9.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#890-2024-10-14)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v8.8.1...v8.9.0)

##### 🩹 Fixes

-   **eslint-plugin:** \[no-unnecessary-type-parameters] cannot assume variables are either type or value

-   **scope-manager:** \[no-use-before-define] do not treat nested namespace aliases as variable references

-   **eslint-plugin:** \[return-await] sync the behavior with await-thenable

-   **eslint-plugin:** \[prefer-literal-enum-member] report a different error message when `allowBitwiseExpressions` is enabled

-   **eslint-plugin:** \[no-loop-func] sync from upstream base rule

-   **eslint-plugin:** \[no-unused-vars] never report the naming of an enum member

-   **eslint-plugin:** correct use-at-your-own-risk type definitions

-   **eslint-plugin:** handle unions in await...for

##### ❤️  Thank You

-   Abraham Guo
-   Anna Bocharova
-   Arya Emami
-   auvred
-   Joshua Chen
-   Kirk Waiblinger
-   Lotfi Meklati
-   mdm317
-   Ronen Amiel
-   Sukka
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v8.8.1`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#881-2024-10-07)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v8.8.0...v8.8.1)

##### 🩹 Fixes

-   **eslint-plugin:** stop warning on [@&#8203;ts-nocheck](https://github.com/ts-nocheck) comments which aren't at the beginning of the file

##### ❤️  Thank You

-   Brad Zacher
-   Ronen Amiel
-   WhitePiano

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v8.8.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#880-2024-09-30)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v8.7.0...v8.8.0)

##### 🚀 Features

-   **eslint-plugin:** \[no-unnecessary-condition] add checkTypePredicates

-   **eslint-plugin:** \[return-await] check for-await loop iteree

##### 🩹 Fixes

-   remove `export type *` in d.ts to support TS<5.0

-   **eslint-plugin:** \[no-unnecessary-template-expression] should underline template syntax with squiggly lines

-   **type-utils:** check for type parameters on `isBuiltinSymbolLikeRecurser()`

-   **eslint-plugin:** \[no-deprecated] max callstack exceeded when class implements itself

-   **eslint-plugin:** \[no-misused-promises] check contextual type

-   **eslint-plugin:** \[prefer-literal-enum-member] allow nested bitwise operations

##### ❤️  Thank You

-   auvred
-   Josh Goldberg 
-   Kirk Waiblinger
-   Ronen Amiel
-   Tarun Chauhan
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v8.7.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#870-2024-09-23)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v8.6.0...v8.7.0)

##### 🚀 Features

-   **eslint-plugin:** \[no-unsafe-call] check calls of Function

-   **eslint-plugin:** \[consistent-type-exports] check `export *` exports to see if all exported members are types

##### 🩹 Fixes

-   **eslint-plugin:** properly coerce all types to string in `getStaticMemberAccessValue`

-   **eslint-plugin:** \[no-deprecated] report on imported deprecated variables

-   **eslint-plugin:** \[no-confusing-non-null-assertion] check !in and !instanceof

##### ❤️  Thank You

-   Abraham Guo
-   auvred
-   Brian Donovan
-   Kirk Waiblinger

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v8.6.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#860-2024-09-16)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v8.5.0...v8.6.0)

##### 🚀 Features

-   add `allow` option for `restrict-template-expressions`

-   **type-utils:** isNullableType add Void logic

-   **eslint-plugin:** \[no-unnecessary-condition] check switch cases

-   **eslint-plugin:** \[no-misused-promises] check array predicate return

##### 🩹 Fixes

-   **eslint-plugin:** \[no-deprecated] don't report recursive types in destructuring assignment twice

-   **eslint-plugin:** \[no-deprecated] report on deprecated variables used in destructuring assignment

-   **eslint-plugin:** \[no-deprecated] report on deprecated properties with function-like types

-   **eslint-plugin:** \[no-unnecessary-condition] properly reflect multiple negations in message

##### ❤️  Thank You

-   Abraham Guo
-   auvred
-   Josh Goldberg 
-   Kim Sang Du
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v8.5.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#850-2024-09-09)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v8.4.0...v8.5.0)

##### 🚀 Features

-   **eslint-plugin:** \[no-duplicate-type-constituents] prevent unnecessary \`

-   **eslint-plugin:** \[no-unsafe-argument] differentiate error types

##### 🩹 Fixes

-   **eslint-plugin:** \[no-unnecessary-type-assertion] fix TSNonNullExpression fixer

-   **eslint-plugin:** \[no-misused-promises] handle static method

-   **eslint-plugin:** \[no-unnecessary-type-parameters] fix AST quick path scope analysis

-   **eslint-plugin:** \[consistent-type-assertions] access parser services lazily

##### ❤️  Thank You

-   [`f44da95`](https://github.com/typescript-eslint/typescript-eslint/commit/f44da958e)
-   Josh Goldberg 
-   Kirk Waiblinger
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v8.4.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#840-2024-09-02)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v8.3.0...v8.4.0)

This was a version bump only for eslint-plugin to align it with other projects, there were no code changes.

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v8.3.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#830-2024-08-26)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v8.2.0...v8.3.0)

##### 🚀 Features

-   **eslint-plugin:** \[no-deprecation] add rule

##### 🩹 Fixes

-   **eslint-plugin:** \[no-unnecessary-template-expression] add missing parentheses in autofix

-   **eslint-plugin:** \[no-unnecessary-type-parameters] check mapped alias type arguments

-   **utils:** add `TSDeclareFunction` to `functionTypeTypes`

-   **ast-spec:** use `Expression` in argument of `ThrowStatement`

##### ❤️  Thank You

-   Abraham Guo
-   Daichi Kamiyama
-   Josh Goldberg 
-   Kim Sang Du
-   Sukka
-   Vida Xie

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AiLCJsYWJlbHMiOlsidHlwZS9kZXBlbmRlbmNpZXMiXX0=-->

Reviewed-on: #230
Reviewed-by: Vylpes <ethan@vylpes.com>
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
2024-10-21 17:31:51 +01:00
10 changed files with 161 additions and 77 deletions

View file

@ -26,6 +26,7 @@ $ random-bunny
Archived = false
Author = Rabbit_Owner
Downvotes = 0
Gallery = https://i.redd.it/sfz0srdrimjc1.png, https://i.redd.it/sfz0srdrimjc1.png
Hidden = false
Permalink = /r/Rabbits/comments/1av1rg9/cute_baby_bun/
Subreddit = Rabbits
@ -35,6 +36,8 @@ Upvotes = 211
Url = https://i.redd.it/sfz0srdrimjc1.png
```
- The `Gallery` field is only shown when there is more than 1 image returned, which then the `Url` field is the first image of that list.
## Help
The command also includes a help option in case you are stuck.
@ -72,9 +75,11 @@ $ random-bunny --json
$ randon-bunny -j
{"Archived":false,"Author":"Rabbit_Owner","Downs":0,"Hidden":false,"Permalink":"/r/Rabbits/comments/1av1rg9/cute_baby_bun/","Subreddit":"Rabbits","SubredditSubscribers":486085,"Title":"Cute baby bun","Ups":210,"Url":"https://i.redd.it/sfz0srdrimjc1.png"}
{"Archived":false,"Author":"Rabbit_Owner","Downs":0,"Hidden":false,"Permalink":"/r/Rabbits/comments/1av1rg9/cute_baby_bun/","Subreddit":"Rabbits","SubredditSubscribers":486085,"Title":"Cute baby bun","Ups":210,"Url":"https://i.redd.it/sfz0srdrimjc1.png","Gallery":["https://i.redd.it/sfz0srdrimjc1.png"]}
```
- The `Url` field is the first image of the `Gallery` array
## Sort
You can also choose the sorting option which reddit will use to return the available posts to randomise from.

View file

@ -39,6 +39,7 @@ The json string which gets returned consists of:
- archived
- author
- downs
- gallery
- hidden
- permalink
- subreddit

View file

@ -2,11 +2,12 @@ export default interface IRedditResult {
Archived: boolean,
Author: string,
Downs: number,
Gallery: string[],
Hidden: boolean,
Permalink: string,
Subreddit: string,
SubredditSubscribers: number,
Title: string,
Ups: number,
Url: string
Url: string,
}

View file

@ -2,17 +2,19 @@ import fetch from "got-cjs";
import * as htmlparser from "htmlparser2";
export default class ImageHelper {
public static async FetchImageFromRedditGallery(url: string): Promise<string | undefined> {
public static async FetchImageFromRedditGallery(url: string): Promise<string[]> {
const fetched = await fetch(url);
if (!fetched || fetched.errored || fetched.statusCode != 200) {
return undefined;
return [];
}
const dom = htmlparser.parseDocument(fetched.body);
const img = htmlparser.DomUtils.findOne((x => x.tagName == "img" && x.attributes.find(y => y.value.includes("https://preview.redd.it")) != null), dom.children, true);
const img = htmlparser.DomUtils.findAll((x => x.tagName == "img" && x.attributes.find(y => y.value.includes("https://preview.redd.it")) != null), dom.children);
const imgSrc = img?.attributes.find(x => x.name == "src")?.value;
const imgSrc = img
.flatMap(x => x.attributes.find(x => x.name == "src")?.value)
.filter(x => x != undefined);
return imgSrc;
}

View file

@ -14,7 +14,13 @@ export default class OutputHelper {
outputLines.push(`Archived = ${result.Archived}`);
outputLines.push(`Author = ${result.Author}`);
outputLines.push(`Downvotes = ${result.Downs}`);
if (result.Gallery.length > 1) {
outputLines.push(`Gallery = ${result.Gallery.join(", ")}`);
}
outputLines.push(`Hidden = ${result.Hidden}`);
outputLines.push(`Permalink = ${result.Permalink}`);
outputLines.push(`Subreddit = ${result.Subreddit}`);
outputLines.push(`Subreddit Subscribers = ${result.SubredditSubscribers}`);
@ -22,6 +28,7 @@ export default class OutputHelper {
outputLines.push(`Upvotes = ${result.Ups}`);
outputLines.push(`Url = ${result.Url}`);
if (options.queryMetadata != null) {
outputLines.push(`Query.Subreddit = ${response.Query.subreddit}`);
outputLines.push(`Query.Sort By = ${response.Query.sortBy}`);

View file

@ -93,6 +93,7 @@ export default async function randomBunny(subreddit: string, sortBy: "new" | "ho
const randomData = randomSelect.data;
let url: string;
let gallery: string[];
if (randomData.url.includes("/gallery")) {
const galleryImage = await ImageHelper.FetchImageFromRedditGallery(randomData.url);
@ -112,9 +113,11 @@ export default async function randomBunny(subreddit: string, sortBy: "new" | "ho
}
}
url = galleryImage;
url = galleryImage[0];
gallery = galleryImage;
} else {
url = randomData.url;
gallery = [randomData.url];
}
const redditResult: IRedditResult = {
@ -128,6 +131,7 @@ export default async function randomBunny(subreddit: string, sortBy: "new" | "ho
Title: randomData['title'],
Ups: randomData['ups'],
Url: url,
Gallery: gallery,
};
return {

View file

@ -13,7 +13,7 @@ Upvotes = 17
Url = https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d"
`;
exports[`GenerateOutput GIVEN options.json is true, EXPECT output to be returned as JSON 1`] = `"{"Archived":false,"Author":"author","Downs":0,"Hidden":false,"Permalink":"/r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/","Subreddit":"Rabbits","SubredditSubscribers":654751,"Title":"This is my Ms Bear!","Ups":17,"Url":"https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d"}"`;
exports[`GenerateOutput GIVEN options.json is true, EXPECT output to be returned as JSON 1`] = `"{"Archived":false,"Author":"author","Downs":0,"Hidden":false,"Permalink":"/r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/","Subreddit":"Rabbits","SubredditSubscribers":654751,"Title":"This is my Ms Bear!","Ups":17,"Url":"https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d","Gallery":["https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d"]}"`;
exports[`GenerateOutput GIVEN options.queryMetadata is supplied, EXPECT query metadata to be added 1`] = `
"Archived = false
@ -30,3 +30,17 @@ Query.Subreddit = rabbits
Query.Sort By = hot
Query.Limit = 100"
`;
exports[`GenerateOutput GIVEN the Gallery input has more than 1 item, EXPECT Gallery line to be added 1`] = `
"Archived = false
Author = author
Downvotes = 0
Gallery = https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d, https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d
Hidden = false
Permalink = /r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/
Subreddit = Rabbits
Subreddit Subscribers = 654751
Title = This is my Ms Bear!
Upvotes = 17
Url = https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d"
`;

View file

@ -17,18 +17,19 @@ describe("FetchImageFromRedditGallery", () => {
expect(fetchMock).toHaveBeenCalledTimes(1);
expect(fetchMock).toHaveBeenCalledWith("https://redd.it/gallery/image");
expect(result).toBe("https://preview.redd.it/image.png");
expect(result.length).toBe(1);
expect(result[0]).toBe("https://preview.redd.it/image.png");
});
test("GIVEN fetch is unable to return data, EXPECT undefined returned", async () => {
test("GIVEN fetch is unable to return data, EXPECT empty array returned", async () => {
fetchMock.mockResolvedValue(null);
const result = await ImageHelper.FetchImageFromRedditGallery("https://redd.it/gallery/image");
expect(result).toBeUndefined();
expect(result.length).toBe(0);
});
test("GIVEN fetch is an error, EXPECT undefined returned", async () => {
test("GIVEN fetch is an error, EXPECT empty array returned", async () => {
fetchMock.mockResolvedValue({
body: "<html><body><img src='https://preview.redd.it/image.png' /></body></html>",
errored: "Error",
@ -37,10 +38,10 @@ describe("FetchImageFromRedditGallery", () => {
const result = await ImageHelper.FetchImageFromRedditGallery("https://redd.it/gallery/image");
expect(result).toBeUndefined();
expect(result.length).toBe(0);
});
test("GIVEN fetch is not status code of 200, EXPECT undefined returned", async () => {
test("GIVEN fetch is not status code of 200, EXPECT empty array returned", async () => {
fetchMock.mockResolvedValue({
body: "<html><body><img src='https://preview.redd.it/image.png' /></body></html>",
errored: undefined,
@ -49,10 +50,10 @@ describe("FetchImageFromRedditGallery", () => {
const result = await ImageHelper.FetchImageFromRedditGallery("https://redd.it/gallery/image");
expect(result).toBeUndefined();
expect(result.length).toBe(0);
});
test("GIVEN image tag is not found, EXPECT undefined returned", async () => {
test("GIVEN image tag is not found, EXPECT empty array returned", async () => {
fetchMock.mockResolvedValue({
body: "<html><body></body></html>",
errored: undefined,
@ -61,10 +62,10 @@ describe("FetchImageFromRedditGallery", () => {
const result = await ImageHelper.FetchImageFromRedditGallery("https://redd.it/gallery/image");
expect(result).toBeUndefined();
expect(result.length).toBe(0);
});
test("GIVEN image source attribute is not found, EXPECT undefined returned", async () => {
test("GIVEN image source attribute is not found, EXPECT empty array returned", async () => {
fetchMock.mockResolvedValue({
body: "<html><body><img /></body></html>",
errored: undefined,
@ -73,10 +74,10 @@ describe("FetchImageFromRedditGallery", () => {
const result = await ImageHelper.FetchImageFromRedditGallery("https://redd.it/gallery/image");
expect(result).toBeUndefined();
expect(result.length).toBe(0);
});
test("GIVEN image source attribute is not found that is a preview.redd.it url, EXPECT undefined returned", async () => {
test("GIVEN image source attribute is not found that is a preview.redd.it url, EXPECT empty array returned", async () => {
fetchMock.mockResolvedValue({
body: "<html><body><img src='main.png' /></body></html>",
errored: undefined,
@ -85,6 +86,6 @@ describe("FetchImageFromRedditGallery", () => {
const result = await ImageHelper.FetchImageFromRedditGallery("https://redd.it/gallery/image");
expect(result).toBeUndefined();
expect(result.length).toBe(0);
});
});

View file

@ -23,6 +23,7 @@ describe("GenerateOutput", () => {
Title: "This is my Ms Bear!",
Ups: 17,
Url: "https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d",
Gallery: ["https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d"],
},
} as IReturnResult;
@ -55,6 +56,7 @@ describe("GenerateOutput", () => {
Title: "This is my Ms Bear!",
Ups: 17,
Url: "https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d",
Gallery: ["https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d"],
},
} as IReturnResult;
@ -89,6 +91,7 @@ describe("GenerateOutput", () => {
Title: "This is my Ms Bear!",
Ups: 17,
Url: "https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d",
Gallery: ["https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d"],
},
} as IReturnResult;
@ -102,4 +105,40 @@ describe("GenerateOutput", () => {
// Assert
expect(result).toMatchSnapshot();
});
test("GIVEN the Gallery input has more than 1 item, EXPECT Gallery line to be added", () => {
// Arrange
const response = {
IsSuccess: true,
Query: {
subreddit: "rabbits",
sortBy: "hot",
limit: 100,
},
Result: {
Archived: false,
Author: 'author',
Downs: 0,
Hidden: false,
Permalink: "/r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/",
Subreddit: "Rabbits",
SubredditSubscribers: 654751,
Title: "This is my Ms Bear!",
Ups: 17,
Url: "https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d",
Gallery: [
"https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d",
"https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d"
],
},
} as IReturnResult;
const options = {} as ICliOptions;
// Act
const result = OutputHelper.GenerateOutput(response, options);
// Assert
expect(result).toMatchSnapshot();
});
});

122
yarn.lock
View file

@ -401,7 +401,12 @@
dependencies:
eslint-visitor-keys "^3.3.0"
"@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.11.0":
"@eslint-community/regexpp@^4.10.0":
version "4.11.1"
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.1.tgz#a547badfc719eb3e5f4b556325e542fbe9d7a18f"
integrity sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==
"@eslint-community/regexpp@^4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae"
integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==
@ -430,11 +435,16 @@
minimatch "^3.1.2"
strip-json-comments "^3.1.1"
"@eslint/js@9.10.0", "@eslint/js@^9.8.0":
"@eslint/js@9.10.0":
version "9.10.0"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.10.0.tgz#eaa3cb0baec497970bb29e43a153d0d5650143c6"
integrity sha512-fuXtbiP5GWIn8Fz+LWoOMVf/Jxm+aajZYkhi6CuEm4SxymFM+eUWzbO9qXT+L0iCkL5+KGYMCSGxo686H19S1g==
"@eslint/js@^9.8.0":
version "9.13.0"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.13.0.tgz#c5f89bcd57eb54d5d4fa8b77693e9c28dc97e547"
integrity sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==
"@eslint/object-schema@^2.1.4":
version "2.1.4"
resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.4.tgz#9e69f8bb4031e11df79e03db09f9dbbae1740843"
@ -908,9 +918,9 @@
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
"@types/node@*", "@types/node@^22.0.0":
version "22.5.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.5.5.tgz#52f939dd0f65fc552a4ad0b392f3c466cc5d7a44"
integrity sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==
version "22.7.7"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.7.tgz#6cd9541c3dccb4f7e8b141b491443f4a1570e307"
integrity sha512-SRxCrrg9CL/y54aiMCG3edPKdprgMVGDXjA3gB8UmmBW5TcXzRUYAh8EWzTnSJFAd1rgImPELza+A3bJ+qxz8Q==
dependencies:
undici-types "~6.19.2"
@ -959,15 +969,15 @@
ts-api-utils "^1.3.0"
"@typescript-eslint/eslint-plugin@^8.0.0":
version "8.2.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.2.0.tgz#bf50e9c8dac6bdf15dd1b52ca29448550903558e"
integrity sha512-02tJIs655em7fvt9gps/+4k4OsKULYGtLBPJfOsmOq1+3cdClYiF0+d6mHu6qDnTcg88wJBkcPLpQhq7FyDz0A==
version "8.10.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.10.0.tgz#9c8218ed62f9a322df10ded7c34990f014df44f2"
integrity sha512-phuB3hoP7FFKbRXxjl+DRlQDuJqhpOnm5MmtROXyWi3uS/Xg2ZXqiQfcG2BJHiN4QKyzdOJi3NEn/qTnjUlkmQ==
dependencies:
"@eslint-community/regexpp" "^4.10.0"
"@typescript-eslint/scope-manager" "8.2.0"
"@typescript-eslint/type-utils" "8.2.0"
"@typescript-eslint/utils" "8.2.0"
"@typescript-eslint/visitor-keys" "8.2.0"
"@typescript-eslint/scope-manager" "8.10.0"
"@typescript-eslint/type-utils" "8.10.0"
"@typescript-eslint/utils" "8.10.0"
"@typescript-eslint/visitor-keys" "8.10.0"
graphemer "^1.4.0"
ignore "^5.3.1"
natural-compare "^1.4.0"
@ -985,14 +995,14 @@
debug "^4.3.4"
"@typescript-eslint/parser@^8.0.0":
version "8.10.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.10.0.tgz#3cbe7206f5e42835878a74a76da533549f977662"
integrity sha512-E24l90SxuJhytWJ0pTQydFT46Nk0Z+bsLKo/L8rtQSL93rQ6byd1V/QbDpHUTdLPOMsBCcYXZweADNCfOCmOAg==
version "8.11.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.11.0.tgz#2ad1481388dc1c937f50b2d138c9ca57cc6c5cce"
integrity sha512-lmt73NeHdy1Q/2ul295Qy3uninSqi6wQI18XwSpm8w0ZbQXUpjCAWP1Vlv/obudoBiIjJVjlztjQ+d/Md98Yxg==
dependencies:
"@typescript-eslint/scope-manager" "8.10.0"
"@typescript-eslint/types" "8.10.0"
"@typescript-eslint/typescript-estree" "8.10.0"
"@typescript-eslint/visitor-keys" "8.10.0"
"@typescript-eslint/scope-manager" "8.11.0"
"@typescript-eslint/types" "8.11.0"
"@typescript-eslint/typescript-estree" "8.11.0"
"@typescript-eslint/visitor-keys" "8.11.0"
debug "^4.3.4"
"@typescript-eslint/scope-manager@7.18.0":
@ -1011,13 +1021,13 @@
"@typescript-eslint/types" "8.10.0"
"@typescript-eslint/visitor-keys" "8.10.0"
"@typescript-eslint/scope-manager@8.2.0":
version "8.2.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.2.0.tgz#4a4bd7e7df5522acc8795c3b6f21e8c41b951138"
integrity sha512-OFn80B38yD6WwpoHU2Tz/fTz7CgFqInllBoC3WP+/jLbTb4gGPTy9HBSTsbDWkMdN55XlVU0mMDYAtgvlUspGw==
"@typescript-eslint/scope-manager@8.11.0":
version "8.11.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.11.0.tgz#9d399ce624118966732824878bc9a83593a30405"
integrity sha512-Uholz7tWhXmA4r6epo+vaeV7yjdKy5QFCERMjs1kMVsLRKIrSdM6o21W2He9ftp5PP6aWOVpD5zvrvuHZC0bMQ==
dependencies:
"@typescript-eslint/types" "8.2.0"
"@typescript-eslint/visitor-keys" "8.2.0"
"@typescript-eslint/types" "8.11.0"
"@typescript-eslint/visitor-keys" "8.11.0"
"@typescript-eslint/type-utils@7.18.0":
version "7.18.0"
@ -1029,13 +1039,13 @@
debug "^4.3.4"
ts-api-utils "^1.3.0"
"@typescript-eslint/type-utils@8.2.0":
version "8.2.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.2.0.tgz#5cd7fef50f492e5a0f508bdd40678861a57c3549"
integrity sha512-g1CfXGFMQdT5S+0PSO0fvGXUaiSkl73U1n9LTK5aRAFnPlJ8dLKkXr4AaLFvPedW8lVDoMgLLE3JN98ZZfsj0w==
"@typescript-eslint/type-utils@8.10.0":
version "8.10.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.10.0.tgz#99f1d2e21f8c74703e7d9c4a67a87271eaf57597"
integrity sha512-PCpUOpyQSpxBn230yIcK+LeCQaXuxrgCm2Zk1S+PTIRJsEfU6nJ0TtwyH8pIwPK/vJoA+7TZtzyAJSGBz+s/dg==
dependencies:
"@typescript-eslint/typescript-estree" "8.2.0"
"@typescript-eslint/utils" "8.2.0"
"@typescript-eslint/typescript-estree" "8.10.0"
"@typescript-eslint/utils" "8.10.0"
debug "^4.3.4"
ts-api-utils "^1.3.0"
@ -1049,10 +1059,10 @@
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.10.0.tgz#eb29c4bc2ed23489348c297469c76d28c38fb618"
integrity sha512-k/E48uzsfJCRRbGLapdZgrX52csmWJ2rcowwPvOZ8lwPUv3xW6CcFeJAXgx4uJm+Ge4+a4tFOkdYvSpxhRhg1w==
"@typescript-eslint/types@8.2.0":
version "8.2.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.2.0.tgz#dfe9895a2812f7c6bf7af863054c22a67060420c"
integrity sha512-6a9QSK396YqmiBKPkJtxsgZZZVjYQ6wQ/TlI0C65z7vInaETuC6HAHD98AGLC8DyIPqHytvNuS8bBVvNLKyqvQ==
"@typescript-eslint/types@8.11.0":
version "8.11.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.11.0.tgz#7c766250502097f49bbc2e651132e6bf489e20b8"
integrity sha512-tn6sNMHf6EBAYMvmPUaKaVeYvhUsrE6x+bXQTxjQRp360h1giATU0WvgeEys1spbvb5R+VpNOZ+XJmjD8wOUHw==
"@typescript-eslint/typescript-estree@7.18.0":
version "7.18.0"
@ -1082,15 +1092,15 @@
semver "^7.6.0"
ts-api-utils "^1.3.0"
"@typescript-eslint/typescript-estree@8.2.0":
version "8.2.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.2.0.tgz#fbdb93a1c7ac7f1f96ae2de4fc97cd64c60ae894"
integrity sha512-kiG4EDUT4dImplOsbh47B1QnNmXSoUqOjWDvCJw/o8LgfD0yr7k2uy54D5Wm0j4t71Ge1NkynGhpWdS0dEIAUA==
"@typescript-eslint/typescript-estree@8.11.0":
version "8.11.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.11.0.tgz#35fe5d3636fc5727c52429393415412e552e222b"
integrity sha512-yHC3s1z1RCHoCz5t06gf7jH24rr3vns08XXhfEqzYpd6Hll3z/3g23JRi0jM8A47UFKNc3u/y5KIMx8Ynbjohg==
dependencies:
"@typescript-eslint/types" "8.2.0"
"@typescript-eslint/visitor-keys" "8.2.0"
"@typescript-eslint/types" "8.11.0"
"@typescript-eslint/visitor-keys" "8.11.0"
debug "^4.3.4"
globby "^11.1.0"
fast-glob "^3.3.2"
is-glob "^4.0.3"
minimatch "^9.0.4"
semver "^7.6.0"
@ -1106,15 +1116,15 @@
"@typescript-eslint/types" "7.18.0"
"@typescript-eslint/typescript-estree" "7.18.0"
"@typescript-eslint/utils@8.2.0":
version "8.2.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.2.0.tgz#02d442285925f28d520587185f295f932702e733"
integrity sha512-O46eaYKDlV3TvAVDNcoDzd5N550ckSe8G4phko++OCSC1dYIb9LTc3HDGYdWqWIAT5qDUKphO6sd9RrpIJJPfg==
"@typescript-eslint/utils@8.10.0":
version "8.10.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.10.0.tgz#d78d1ce3ea3d2a88a2593ebfb1c98490131d00bf"
integrity sha512-Oq4uZ7JFr9d1ZunE/QKy5egcDRXT/FrS2z/nlxzPua2VHFtmMvFNDvpq1m/hq0ra+T52aUezfcjGRIB7vNJF9w==
dependencies:
"@eslint-community/eslint-utils" "^4.4.0"
"@typescript-eslint/scope-manager" "8.2.0"
"@typescript-eslint/types" "8.2.0"
"@typescript-eslint/typescript-estree" "8.2.0"
"@typescript-eslint/scope-manager" "8.10.0"
"@typescript-eslint/types" "8.10.0"
"@typescript-eslint/typescript-estree" "8.10.0"
"@typescript-eslint/visitor-keys@7.18.0":
version "7.18.0"
@ -1132,12 +1142,12 @@
"@typescript-eslint/types" "8.10.0"
eslint-visitor-keys "^3.4.3"
"@typescript-eslint/visitor-keys@8.2.0":
version "8.2.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.2.0.tgz#f6abb3b6508898a117175ddc11f9b9869cc96834"
integrity sha512-sbgsPMW9yLvS7IhCi8IpuK1oBmtbWUNP+hBdwl/I9nzqVsszGnNGti5r9dUtF5RLivHUFFIdRvLiTsPhzSyJ3Q==
"@typescript-eslint/visitor-keys@8.11.0":
version "8.11.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.11.0.tgz#273de1cbffe63d9f9cd7dfc20b5a5af66310cb92"
integrity sha512-EaewX6lxSjRJnc+99+dqzTeoDZUfyrA52d2/HRrkI830kgovWsmIiTfmr0NZorzqic7ga+1bS60lRBUgR3n/Bw==
dependencies:
"@typescript-eslint/types" "8.2.0"
"@typescript-eslint/types" "8.11.0"
eslint-visitor-keys "^3.4.3"
"@yao-pkg/pkg-fetch@3.5.10":
@ -2595,12 +2605,12 @@ ignore-walk@^6.0.4:
dependencies:
minimatch "^9.0.0"
ignore@^5.2.0:
ignore@^5.2.0, ignore@^5.3.1:
version "5.3.2"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5"
integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==
ignore@^5.2.4, ignore@^5.3.1:
ignore@^5.2.4:
version "5.3.1"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef"
integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==