mirror of
https://github.com/type-challenges/type-challenges.git
synced 2026-02-01 15:47:22 +00:00
Merge branch 'main' into dependabot/npm_and_yarn/js-yaml-4.1.1
This commit is contained in:
commit
71ea914fc6
68
pnpm-lock.yaml
generated
68
pnpm-lock.yaml
generated
@ -26,7 +26,7 @@ importers:
|
||||
devDependencies:
|
||||
'@antfu/eslint-config':
|
||||
specifier: ^2.6.0
|
||||
version: 2.6.0(@vue/compiler-sfc@3.5.24)(eslint@8.56.0)(typescript@5.3.3)
|
||||
version: 2.6.0(@vue/compiler-sfc@3.5.27)(eslint@8.56.0)(typescript@5.3.3)
|
||||
'@type-challenges/utils':
|
||||
specifier: workspace:*
|
||||
version: link:utils
|
||||
@ -164,7 +164,7 @@ packages:
|
||||
resolution: {integrity: sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==}
|
||||
dev: false
|
||||
|
||||
/@antfu/eslint-config@2.6.0(@vue/compiler-sfc@3.5.24)(eslint@8.56.0)(typescript@5.3.3):
|
||||
/@antfu/eslint-config@2.6.0(@vue/compiler-sfc@3.5.27)(eslint@8.56.0)(typescript@5.3.3):
|
||||
resolution: {integrity: sha512-OSRD/5KarXbzEhiVBWu8NcRTW7aDsuvwvBBMbpGAtCTJDS97wATT2Xx+t2T26HGNuwz0TZDi5mNTwWCm7vJORQ==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
@ -218,7 +218,7 @@ packages:
|
||||
eslint-plugin-vitest: 0.3.20(@typescript-eslint/eslint-plugin@6.16.0)(eslint@8.56.0)(typescript@5.3.3)
|
||||
eslint-plugin-vue: 9.19.2(eslint@8.56.0)
|
||||
eslint-plugin-yml: 1.11.0(eslint@8.56.0)
|
||||
eslint-processor-vue-blocks: 0.1.1(@vue/compiler-sfc@3.5.24)(eslint@8.56.0)
|
||||
eslint-processor-vue-blocks: 0.1.1(@vue/compiler-sfc@3.5.27)(eslint@8.56.0)
|
||||
globals: 13.24.0
|
||||
jsonc-eslint-parser: 2.4.0
|
||||
local-pkg: 0.5.0
|
||||
@ -280,16 +280,16 @@ packages:
|
||||
js-tokens: 4.0.0
|
||||
dev: true
|
||||
|
||||
/@babel/parser@7.28.5:
|
||||
resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==}
|
||||
/@babel/parser@7.28.6:
|
||||
resolution: {integrity: sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
'@babel/types': 7.28.5
|
||||
'@babel/types': 7.28.6
|
||||
dev: true
|
||||
|
||||
/@babel/types@7.28.5:
|
||||
resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==}
|
||||
/@babel/types@7.28.6:
|
||||
resolution: {integrity: sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
dependencies:
|
||||
'@babel/helper-string-parser': 7.27.1
|
||||
@ -1092,46 +1092,46 @@ packages:
|
||||
- encoding
|
||||
dev: false
|
||||
|
||||
/@vue/compiler-core@3.5.24:
|
||||
resolution: {integrity: sha512-eDl5H57AOpNakGNAkFDH+y7kTqrQpJkZFXhWZQGyx/5Wh7B1uQYvcWkvZi11BDhscPgj8N7XV3oRwiPnx1Vrig==}
|
||||
/@vue/compiler-core@3.5.27:
|
||||
resolution: {integrity: sha512-gnSBQjZA+//qDZen+6a2EdHqJ68Z7uybrMf3SPjEGgG4dicklwDVmMC1AeIHxtLVPT7sn6sH1KOO+tS6gwOUeQ==}
|
||||
dependencies:
|
||||
'@babel/parser': 7.28.5
|
||||
'@vue/shared': 3.5.24
|
||||
entities: 4.5.0
|
||||
'@babel/parser': 7.28.6
|
||||
'@vue/shared': 3.5.27
|
||||
entities: 7.0.1
|
||||
estree-walker: 2.0.2
|
||||
source-map-js: 1.2.1
|
||||
dev: true
|
||||
|
||||
/@vue/compiler-dom@3.5.24:
|
||||
resolution: {integrity: sha512-1QHGAvs53gXkWdd3ZMGYuvQFXHW4ksKWPG8HP8/2BscrbZ0brw183q2oNWjMrSWImYLHxHrx1ItBQr50I/q2zw==}
|
||||
/@vue/compiler-dom@3.5.27:
|
||||
resolution: {integrity: sha512-oAFea8dZgCtVVVTEC7fv3T5CbZW9BxpFzGGxC79xakTr6ooeEqmRuvQydIiDAkglZEAd09LgVf1RoDnL54fu5w==}
|
||||
dependencies:
|
||||
'@vue/compiler-core': 3.5.24
|
||||
'@vue/shared': 3.5.24
|
||||
'@vue/compiler-core': 3.5.27
|
||||
'@vue/shared': 3.5.27
|
||||
dev: true
|
||||
|
||||
/@vue/compiler-sfc@3.5.24:
|
||||
resolution: {integrity: sha512-8EG5YPRgmTB+YxYBM3VXy8zHD9SWHUJLIGPhDovo3Z8VOgvP+O7UP5vl0J4BBPWYD9vxtBabzW1EuEZ+Cqs14g==}
|
||||
/@vue/compiler-sfc@3.5.27:
|
||||
resolution: {integrity: sha512-sHZu9QyDPeDmN/MRoshhggVOWE5WlGFStKFwu8G52swATgSny27hJRWteKDSUUzUH+wp+bmeNbhJnEAel/auUQ==}
|
||||
dependencies:
|
||||
'@babel/parser': 7.28.5
|
||||
'@vue/compiler-core': 3.5.24
|
||||
'@vue/compiler-dom': 3.5.24
|
||||
'@vue/compiler-ssr': 3.5.24
|
||||
'@vue/shared': 3.5.24
|
||||
'@babel/parser': 7.28.6
|
||||
'@vue/compiler-core': 3.5.27
|
||||
'@vue/compiler-dom': 3.5.27
|
||||
'@vue/compiler-ssr': 3.5.27
|
||||
'@vue/shared': 3.5.27
|
||||
estree-walker: 2.0.2
|
||||
magic-string: 0.30.21
|
||||
postcss: 8.5.6
|
||||
source-map-js: 1.2.1
|
||||
dev: true
|
||||
|
||||
/@vue/compiler-ssr@3.5.24:
|
||||
resolution: {integrity: sha512-trOvMWNBMQ/odMRHW7Ae1CdfYx+7MuiQu62Jtu36gMLXcaoqKvAyh+P73sYG9ll+6jLB6QPovqoKGGZROzkFFg==}
|
||||
/@vue/compiler-ssr@3.5.27:
|
||||
resolution: {integrity: sha512-Sj7h+JHt512fV1cTxKlYhg7qxBvack+BGncSpH+8vnN+KN95iPIcqB5rsbblX40XorP+ilO7VIKlkuu3Xq2vjw==}
|
||||
dependencies:
|
||||
'@vue/compiler-dom': 3.5.24
|
||||
'@vue/shared': 3.5.24
|
||||
'@vue/compiler-dom': 3.5.27
|
||||
'@vue/shared': 3.5.27
|
||||
dev: true
|
||||
|
||||
/@vue/shared@3.5.24:
|
||||
resolution: {integrity: sha512-9cwHL2EsJBdi8NY22pngYYWzkTDhld6fAD6jlaeloNGciNSJL6bLpbxVgXl96X00Jtc6YWQv96YA/0sxex/k1A==}
|
||||
/@vue/shared@3.5.27:
|
||||
resolution: {integrity: sha512-dXr/3CgqXsJkZ0n9F3I4elY8wM9jMJpP3pvRG52r6m0tu/MsAFIe6JpXVGeNMd/D9F4hQynWT8Rfuj0bdm9kFQ==}
|
||||
dev: true
|
||||
|
||||
/acorn-jsx@5.3.2(acorn@8.11.2):
|
||||
@ -1420,8 +1420,8 @@ packages:
|
||||
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
|
||||
dev: true
|
||||
|
||||
/entities@4.5.0:
|
||||
resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
|
||||
/entities@7.0.1:
|
||||
resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==}
|
||||
engines: {node: '>=0.12'}
|
||||
dev: true
|
||||
|
||||
@ -1803,13 +1803,13 @@ packages:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/eslint-processor-vue-blocks@0.1.1(@vue/compiler-sfc@3.5.24)(eslint@8.56.0):
|
||||
/eslint-processor-vue-blocks@0.1.1(@vue/compiler-sfc@3.5.27)(eslint@8.56.0):
|
||||
resolution: {integrity: sha512-9+dU5lU881log570oBwpelaJmOfOzSniben7IWEDRYQPPWwlvaV7NhOtsTuUWDqpYT+dtKKWPsgz4OkOi+aZnA==}
|
||||
peerDependencies:
|
||||
'@vue/compiler-sfc': ^3.3.0
|
||||
eslint: ^8.50.0
|
||||
dependencies:
|
||||
'@vue/compiler-sfc': 3.5.24
|
||||
'@vue/compiler-sfc': 3.5.27
|
||||
eslint: 8.56.0
|
||||
dev: true
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--info-header-start--><h1>Filter <img src="https://img.shields.io/badge/-%EB%B3%B4%ED%86%B5-d9901a" alt="보통"/> <img src="https://img.shields.io/badge/-%23array-999" alt="#array"/> <img src="https://img.shields.io/badge/-%23filter-999" alt="#filter"/></h1><blockquote><p>by Muhun Kim <a href="https://github.com/x86chi" target="_blank">@x86chi</a></p></blockquote><p><a href="https://tsch.js.org/18220/play/ko" target="_blank"><img src="https://img.shields.io/badge/-%EB%8F%84%EC%A0%84%ED%95%98%EA%B8%B0-3178c6?logo=typescript&logoColor=white" alt="도전하기"/></a> <a href="./README.md" target="_blank"><img src="https://img.shields.io/badge/-English-gray" alt="English"/></a> </p><!--info-header-end-->
|
||||
<!--info-header-start--><h1>Filter <img src="https://img.shields.io/badge/-%EB%B3%B4%ED%86%B5-d9901a" alt="보통"/> <img src="https://img.shields.io/badge/-%23array-999" alt="#array"/> <img src="https://img.shields.io/badge/-%23filter-999" alt="#filter"/></h1><blockquote><p>by Mu-Hun <a href="https://github.com/mu-hun" target="_blank">@mu-hun</a></p></blockquote><p><a href="https://tsch.js.org/18220/play/ko" target="_blank"><img src="https://img.shields.io/badge/-%EB%8F%84%EC%A0%84%ED%95%98%EA%B8%B0-3178c6?logo=typescript&logoColor=white" alt="도전하기"/></a> <a href="./README.md" target="_blank"><img src="https://img.shields.io/badge/-English-gray" alt="English"/></a> </p><!--info-header-end-->
|
||||
|
||||
원시 타입 또는 유니온 원시 타입인 `Predicate`과 `Predicate`의 요소로 포함되는 배열을 반환하고, 배열 `T`를 가지는 `Filter<T, Predicate>` 타입을 구현하세요.
|
||||
타입 `Filter<T, Predicate>`를 구현하세요. 여기서 `T`는 배열이고, `Predicate`는 원시 타입 또는 원시 타입의 유니온입니다. 결과는 `Predicate`에 속하는 원시 타입만 가진 배열이어야 합니다.
|
||||
|
||||
|
||||
<!--info-footer-start--><br><a href="../../README.ko.md" target="_blank"><img src="https://img.shields.io/badge/-%EB%8F%8C%EC%95%84%EA%B0%80%EA%B8%B0-grey" alt="돌아가기"/></a> <a href="https://tsch.js.org/18220/answer/ko" target="_blank"><img src="https://img.shields.io/badge/-%EC%A0%95%EB%8B%B5%20%EA%B3%B5%EC%9C%A0%ED%95%98%EA%B8%B0-teal" alt="정답 공유하기"/></a> <a href="https://tsch.js.org/18220/solutions" target="_blank"><img src="https://img.shields.io/badge/-%EC%A0%95%EB%8B%B5%20%EB%B3%B4%EA%B8%B0-de5a77?logo=awesome-lists&logoColor=white" alt="정답 보기"/></a> <!--info-footer-end-->
|
||||
<!--info-footer-start--><br><a href="../../README.ko.md" target="_blank"><img src="https://img.shields.io/badge/-%EB%8F%8C%EC%95%84%EA%B0%80%EA%B8%B0-grey" alt="돌아가기"/></a> <a href="https://tsch.js.org/18220/answer/ko" target="_blank"><img src="https://img.shields.io/badge/-%EC%A0%95%EB%8B%B5%20%EA%B3%B5%EC%9C%A0%ED%95%98%EA%B8%B0-teal" alt="정답 공유하기"/></a> <a href="https://tsch.js.org/18220/solutions" target="_blank"><img src="https://img.shields.io/badge/-%EC%A0%95%EB%8B%B5%20%EB%B3%B4%EA%B8%B0-de5a77?logo=awesome-lists&logoColor=white" alt="정답 보기"/></a> <!--info-footer-end-->
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--info-header-start--><h1>Filter <img src="https://img.shields.io/badge/-medium-d9901a" alt="medium"/> <img src="https://img.shields.io/badge/-%23array-999" alt="#array"/> <img src="https://img.shields.io/badge/-%23filter-999" alt="#filter"/></h1><blockquote><p>by Muhun Kim <a href="https://github.com/x86chi" target="_blank">@x86chi</a></p></blockquote><p><a href="https://tsch.js.org/18220/play" target="_blank"><img src="https://img.shields.io/badge/-Take%20the%20Challenge-3178c6?logo=typescript&logoColor=white" alt="Take the Challenge"/></a> <a href="./README.ko.md" target="_blank"><img src="https://img.shields.io/badge/-%ED%95%9C%EA%B5%AD%EC%96%B4-gray" alt="한국어"/></a> </p><!--info-header-end-->
|
||||
<!--info-header-start--><h1>Filter <img src="https://img.shields.io/badge/-medium-d9901a" alt="medium"/> <img src="https://img.shields.io/badge/-%23array-999" alt="#array"/> <img src="https://img.shields.io/badge/-%23filter-999" alt="#filter"/></h1><blockquote><p>by Mu-Hun <a href="https://github.com/mu-hun" target="_blank">@mu-hun</a></p></blockquote><p><a href="https://tsch.js.org/18220/play" target="_blank"><img src="https://img.shields.io/badge/-Take%20the%20Challenge-3178c6?logo=typescript&logoColor=white" alt="Take the Challenge"/></a> <a href="./README.ko.md" target="_blank"><img src="https://img.shields.io/badge/-%ED%95%9C%EA%B5%AD%EC%96%B4-gray" alt="한국어"/></a> </p><!--info-header-end-->
|
||||
|
||||
Implement the type `Filter<T, Predicate>` takes an Array `T`, primitive type or union primitive type `Predicate` and returns an Array include the elements of `Predicate`.
|
||||
Implement the type `Filter<T, Predicate>`. Here `T` is an array, and `Predicate` is a primitive type or a union of primitive types. The result should be an array that contains only those elements whose types are included in `Predicate`.
|
||||
|
||||
|
||||
<!--info-footer-start--><br><a href="../../README.md" target="_blank"><img src="https://img.shields.io/badge/-Back-grey" alt="Back"/></a> <a href="https://tsch.js.org/18220/answer" target="_blank"><img src="https://img.shields.io/badge/-Share%20your%20Solutions-teal" alt="Share your Solutions"/></a> <a href="https://tsch.js.org/18220/solutions" target="_blank"><img src="https://img.shields.io/badge/-Check%20out%20Solutions-de5a77?logo=awesome-lists&logoColor=white" alt="Check out Solutions"/></a> <!--info-footer-end-->
|
||||
<!--info-footer-start--><br><a href="../../README.md" target="_blank"><img src="https://img.shields.io/badge/-Back-grey" alt="Back"/></a> <a href="https://tsch.js.org/18220/answer" target="_blank"><img src="https://img.shields.io/badge/-Share%20your%20Solutions-teal" alt="Share your Solutions"/></a> <a href="https://tsch.js.org/18220/solutions" target="_blank"><img src="https://img.shields.io/badge/-Check%20out%20Solutions-de5a77?logo=awesome-lists&logoColor=white" alt="Check out Solutions"/></a> <!--info-footer-end-->
|
||||
|
||||
@ -2,5 +2,5 @@ difficulty: medium
|
||||
title: Filter
|
||||
tags: array, filter
|
||||
author:
|
||||
github: x86chi
|
||||
name: Muhun Kim
|
||||
github: mu-hun
|
||||
name: Mu-Hun
|
||||
|
||||
13
questions/19749-medium-isequal/README.md
Normal file
13
questions/19749-medium-isequal/README.md
Normal file
@ -0,0 +1,13 @@
|
||||
Implements the equal operator that returns a boolean for whether the two given types are equal.
|
||||
|
||||
For example:
|
||||
|
||||
```ts
|
||||
type X1 = 1
|
||||
type Y1 = 1
|
||||
type T1 = IsEqual<X1, Y1> // expected to be true
|
||||
|
||||
type X2 = 1
|
||||
type Y2 = 2
|
||||
type T2 = IsEqual<X2, Y2> // expected to be false
|
||||
```
|
||||
7
questions/19749-medium-isequal/info.yml
Normal file
7
questions/19749-medium-isequal/info.yml
Normal file
@ -0,0 +1,7 @@
|
||||
difficulty: medium
|
||||
title: IsEqual
|
||||
tags: utils
|
||||
author:
|
||||
github: doz13189
|
||||
name: Takahiro Kato
|
||||
|
||||
1
questions/19749-medium-isequal/template.ts
Normal file
1
questions/19749-medium-isequal/template.ts
Normal file
@ -0,0 +1 @@
|
||||
type IsEqual<X, Y> = any
|
||||
10
questions/19749-medium-isequal/test-cases.ts
Normal file
10
questions/19749-medium-isequal/test-cases.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import type { Equal, Expect } from '@type-challenges/utils'
|
||||
|
||||
type cases = [
|
||||
Expect<Equal<IsEqual<number, string>, false>>,
|
||||
Expect<Equal<IsEqual<1, 1>, true>>,
|
||||
Expect<Equal<IsEqual<any, 1>, false>>,
|
||||
Expect<Equal<IsEqual<1 | 2, 1>, false>>,
|
||||
Expect<Equal<IsEqual<any, never>, false>>,
|
||||
Expect<Equal<IsEqual<[any], [number]>, false>>,
|
||||
]
|
||||
Loading…
x
Reference in New Issue
Block a user