ernie-research/MEnvData-SWE huggingface dataset:
Repository: graphql/graphql-js (TypeScript)

Issue:
Printing the @oneOf directive
It looks like currently the `printSchema` function doesn't have any handling for `@oneOf`.

I'm not sure if this is intentional or not, because I know printing directives has historically been a controversial topic, but my expectation would be that for directives that are part of the spec and have a corresponding option in the options when creating the type/field in code (eg `deprecationReason`/`@deprecated` ) would be printed when using  `printSchema`.

I'm happy to make a PR to add this, and it looks like it should be a pretty simple fix handled here: https://github.com/graphql/graphql-js/blob/main/src/utilities/printSchema.ts#L207C5-L207C5


Discussion:
Thanks for spotting this! Can confirm that the [RFC definitely states](https://github.com/graphql/graphql-spec/pull/825/files#diff-30a69c5a5eded8e1aea52e53dad1181e6ec8f549ca2c50570b035153e2de1c43) the directive should be present; this isn't "metadata" (unlike graphql/graphql-spec#300) - it's a concrete `__Type.isOneOf` introspection field and without this we'd lose introspection<->SDL equivalence.



Patch:
diff --git a/src/utilities/printSchema.ts b/src/utilities/printSchema.ts
index c987f64ae1..c4caffc616 100644
--- a/src/utilities/printSchema.ts
+++ b/src/utilities/printSchema.ts
@@ -204,7 +204,12 @@ function printInputObject(type: GraphQLInputObjectType): string {
   const fields = Object.values(type.getFields()).map(
     (f, i) => printDescription(f, '  ', !i) + '  ' + printInputValue(f),
   );
-  return printDescription(type) + `input ${type.name}` + printBlock(fields);
+  return (
+    printDescription(type) +
+    `input ${type.name}` +
+    (type.isOneOf ? ' @oneOf' : '') +
+    printBlock(fields)
+  );
 }
 
 function printFields(type: GraphQLObjectType | GraphQLInterfaceType): string {


Test patch:
diff --git a/src/utilities/__tests__/printSchema-test.ts b/src/utilities/__tests__/printSchema-test.ts
index 5b7116648a..78f793b183 100644
--- a/src/utilities/__tests__/printSchema-test.ts
+++ b/src/utilities/__tests__/printSchema-test.ts
@@ -509,6 +509,23 @@ describe('Type System Printer', () => {
     `);
   });
 
+  it('Print Input Type with @oneOf directive', () => {
+    const InputType = new GraphQLInputObjectType({
+      name: 'InputType',
+      isOneOf: true,
+      fields: {
+        int: { type: GraphQLInt },
+      },
+    });
+
+    const schema = new GraphQLSchema({ types: [InputType] });
+    expectPrintedSchema(schema).to.equal(dedent`
+      input InputType @oneOf {
+        int: Int
+      }
+    `);
+  });
+
   it('Custom Scalar', () => {
     const OddType = new GraphQLScalarType({ name: 'Odd' });
Repository: harttle/liquidjs (TypeScript)

Issue:
Feature request: allow `lenientIf` for multiple operands
Currently, `lenientIf` config option only applies to statements with a single operand.
This is a different behavior from the Shopify (Ruby) liquid.

Current behavior (`strictVariables` and `lenientIf` are both set to `true`):
- `{% if nonexistent %}{% endif %}` works fine
- `{% if nonexistent == "value" %}one{% else %}two{% endif %}` returns an error

Expected:
- `{% if nonexistent == "value" %}one{% else %}two{% endif %}` to return `two`
- `{% if nonexistent != "value" %}one{% else %}two{% endif %}`  to return `one`


Discussion:

Patch:
diff --git a/src/render/expression.ts b/src/render/expression.ts
index fdb93da574..9bfca3e302 100644
--- a/src/render/expression.ts
+++ b/src/render/expression.ts
@@ -24,7 +24,7 @@ export class Expression {
         }
         operands.push(result)
       } else {
-        operands.push(yield evalToken(token, ctx, lenient && this.postfix.length === 1))
+        operands.push(yield evalToken(token, ctx, lenient))
       }
     }
     return operands[0]


Test patch:
diff --git a/test/integration/liquid/strict.spec.ts b/test/integration/liquid/strict.spec.ts
index b3365cd14a..b80b584555 100644
--- a/test/integration/liquid/strict.spec.ts
+++ b/test/integration/liquid/strict.spec.ts
@@ -55,10 +55,15 @@ describe('LiquidOptions#strict*', function () {
       const html = await engine.render(tpl, ctx)
       return expect(html).toBe('beforeXafter')
     })
-    it('should still throw with an undefined variable in a compound `if` expression', function () {
-      const tpl = engine.parse('{% if notdefined == 15 %}a{% endif %}')
-      const fhtml = engine.render(tpl, ctx)
-      return expect(fhtml).rejects.toThrow(/undefined variable: notdefined/)
+    it('should not throw with an undefined variable in a compound `if` expression', async function () {
+      const tpl = engine.parse('before{% if notdefined == 15 %}X{% else %}Y{% endif %}after')
+      const html = await engine.render(tpl, ctx)
+      return expect(html).toBe('beforeYafter')
+    })
+    it('should correctly evaluate undefined variable in a compound `if` expression', async function () {
+      const tpl = engine.parse('before{% if notdefined != "value" %}X{% else %}Y{% endif %}after')
+      const html = await engine.render(tpl, ctx)
+      return expect(html).toBe('beforeXafter')
     })
     it('should allow an undefined variable when before the `default` filter', async function () {
       const tpl = engine.parse('{{notdefined | default: "a" | tolower}}')
Repository: honojs/hono (TypeScript)

Issue:
`hono/validator` cannot validate if charset is included in the Content-Type of URL Encoded Data
### What version of Hono are you using?

4.5.6

### What runtime/platform is your app running on?

Node.js, Bun

### What steps can reproduce the bug?

When you try to validate a request whose Content-Type is `application/x-www-form-urlencoded; charset=UTF-8` with `hono/validator`, the value cannot be validated correctly.

code: 

```ts
import { Hono } from 'hono';
import { validator } from 'hono/validator';

const app = new Hono()
app.post(
  '/post',
  validator('form', (value) => value),
  (c) => {
    return c.json({
      validation_result: c.req.valid('form'),
      formData: await c.req.formData(),
    })
  }
)

export default app
```

request:

```bash
$> curl -XPOST \
       -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
       -d 'a=foo&b=bar' \
    'http://localhost:3000'

> { "validation_result": {}, "formData": { "a":"foo", "b":"bar" } }
```

### What is the expected behavior?

The value of validate_result and formData should be the same.

```bash
$> curl -XPOST \
       -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
       -d 'a=foo&b=bar' \
    'http://localhost:3000'

> { "validation_result": { "a":"foo", "b":"bar" }, "formData": { "a":"foo", "b":"bar" } }
```

### What do you see instead?

_No response_

### Additional information

_No response_


Discussion:

Patch:
diff --git a/src/validator/validator.ts b/src/validator/validator.ts
index 68ddabd2d..ae1e16284 100644
--- a/src/validator/validator.ts
+++ b/src/validator/validator.ts
@@ -25,7 +25,7 @@ type ExcludeResponseType<T> = T extends Response & TypedResponse<any> ? never :
 
 const jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/
 const multipartRegex = /^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/
-const urlencodedRegex = /^application\/x-www-form-urlencoded$/
+const urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/
 
 export const validator = <
   InputType,


Test patch:
diff --git a/src/validator/validator.test.ts b/src/validator/validator.test.ts
index aad7785bb..83af4481a 100644
--- a/src/validator/validator.test.ts
+++ b/src/validator/validator.test.ts
@@ -247,6 +247,22 @@ describe('FormData', () => {
     })
   })
 
+  it('Should validate if Content-Type is a application/x-www-form-urlencoded with a charset', async () => {
+    const params = new URLSearchParams()
+    params.append('foo', 'bar')
+    const res = await app.request('/post', {
+      method: 'POST',
+      body: params,
+      headers: {
+        'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
+      },
+    })
+    expect(res.status).toBe(200)
+    expect(await res.json()).toEqual({
+      foo: 'bar',
+    })
+  })
+
   it('Should return `foo[]` as an array', async () => {
     const form = new FormData()
     form.append('foo[]', 'bar1')
Repository: YousefED/typescript-json-schema (TypeScript)

Issue:
RegExp special characters are not escaped for string template literals
A string template literal like `${string}.${string}` currently produces a string pattern of `"^.*..*$"` in the resulting JSON schema while the correct pattern would be `"^.*\\..*$"`.


Discussion:

Patch:
diff --git a/api.md b/api.md
index bb47b106..94c3f5d2 100644
--- a/api.md
+++ b/api.md
@@ -1445,6 +1445,24 @@ class MyObject {
 ```
 
 
+## [string-template-literal](./test/programs/string-template-literal)
+
+```ts
+interface MyObject {
+  a: `@${string}`,
+  b: `@${number}`,
+  c: `@${bigint}`,
+  d: `@${boolean}`,
+  e: `@${undefined}`,
+  f: `@${null}`,
+  g: `${string}@`,
+  h: `${number}@`,
+  i: `${string}@${number}`,
+  j: `${string}.${string}`,
+}
+```
+
+
 ## [symbol](./test/programs/symbol)
 
 ```ts
diff --git a/typescript-json-schema.ts b/typescript-json-schema.ts
index 68c34bf2..40439843 100644
--- a/typescript-json-schema.ts
+++ b/typescript-json-schema.ts
@@ -753,7 +753,7 @@ export class JsonSchemaGenerator {
                         const {texts, types} = propertyType;
                         const pattern = [];
                         for (let i = 0; i < texts.length; i++) {
-                            const text = texts[i];
+                            const text = texts[i].replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
                             const type = types[i];
 
                             if (i === 0) {


Test patch:
diff --git a/test/programs/string-template-literal/main.ts b/test/programs/string-template-literal/main.ts
index 4b0745b0..f554704e 100644
--- a/test/programs/string-template-literal/main.ts
+++ b/test/programs/string-template-literal/main.ts
@@ -8,4 +8,5 @@ interface MyObject {
   g: `${string}@`,
   h: `${number}@`,
   i: `${string}@${number}`,
+  j: `${string}.${string}`,
 }
\ No newline at end of file
diff --git a/test/programs/string-template-literal/schema.json b/test/programs/string-template-literal/schema.json
index cc39dd2c..cc1e1e08 100644
--- a/test/programs/string-template-literal/schema.json
+++ b/test/programs/string-template-literal/schema.json
@@ -39,6 +39,10 @@
       "i": {
         "type": "string",
         "pattern": "^.*@[0-9]*$"
+      },
+      "j": {
+        "type": "string",
+        "pattern": "^.*\\..*$"
       }
     },
     "additionalProperties": false,
@@ -51,7 +55,8 @@
       "f",
       "g",
       "h",
-      "i"
+      "i",
+      "j"
     ],
     "$schema": "http://json-schema.org/draft-07/schema#"
 }
\ No newline at end of file
Repository: capricorn86/happy-dom (TypeScript)

Issue:
Parsing error with special characters (æøåÆØÅ) in unquoted attribute value
**Describe the bug**
Special characters, in this case æ, ø, å, Æ, Ø or Å are not working correctly when parsing unquoted attributes.

**To Reproduce**
Steps to reproduce the behavior:
Run the reproduction script:
```javascript
import { Window } from "happy-dom";
const window = new Window();
window.document.body.innerHTML = "<div id=æøåÆØÅ></div>";
const output = window.document.body.innerHTML;
// Expected output: <div id="æøåÆØÅ"></div>
// Actual output: <div id=""></div>
console.log(output);
```

**Expected behavior**
Expected output: `<div id="æøåÆØÅ"></div>`, as the input is valid HTML.

**Device:**
 - happy-dom: 17.4.7
 - Node.js: 22.15.1

**Additional context**
Probably related to #1237.


Discussion:

Patch:
diff --git a/packages/happy-dom/src/html-parser/HTMLParser.ts b/packages/happy-dom/src/html-parser/HTMLParser.ts
index d24c112cf..46b5d7a7c 100755
--- a/packages/happy-dom/src/html-parser/HTMLParser.ts
+++ b/packages/happy-dom/src/html-parser/HTMLParser.ts
@@ -47,7 +47,7 @@ const MARKUP_REGEXP = /<([^\s/!>?]+)|<\/([^\s/!>?]+)\s*>|(<!--)|(-->|--!>)|(<!)|
  * Group 9: Attribute name when the attribute has no value (e.g. "disabled" in "<div disabled>").
  */
 const ATTRIBUTE_REGEXP =
-	/\s*([a-zA-Z0-9-_:.$@?\\<\[\]]+)\s*=\s*([a-zA-Z0-9-_:.$@?{}/<]+)|\s*([a-zA-Z0-9-_:.$@?\\<\[\]]+)\s*=\s*"([^"]*)("{0,1})|\s*([a-zA-Z0-9-_:.$@?\\<\[\]]+)\s*=\s*'([^']*)('{0,1})|\s*([a-zA-Z0-9-_:.$@?\\<\[\]]+)/gm;
+	/\s*([a-zA-Z0-9-_:.$@?\\<\[\]]+)\s*=\s*([^"'=<>\\`\s]+)|\s*([a-zA-Z0-9-_:.$@?\\<\[\]]+)\s*=\s*"([^"]*)("{0,1})|\s*([a-zA-Z0-9-_:.$@?\\<\[\]]+)\s*=\s*'([^']*)('{0,1})|\s*([a-zA-Z0-9-_:.$@?\\<\[\]]+)/gm;
 
 /**
  * Document type attribute RegExp.


Test patch:
diff --git a/packages/happy-dom/test/html-parser/HTMLParser.test.ts b/packages/happy-dom/test/html-parser/HTMLParser.test.ts
index 61a12767f..ce84768f8 100644
--- a/packages/happy-dom/test/html-parser/HTMLParser.test.ts
+++ b/packages/happy-dom/test/html-parser/HTMLParser.test.ts
@@ -116,6 +116,13 @@ describe('HTMLParser', () => {
 			).toBe(true);
 		});
 
+		it('Parses HTML with unquoted attributes with special characters.', () => {
+			const result = new HTMLParser(window).parse('<div id=æøåÆØÅ></div>');
+			expect(result.childNodes.length).toBe(1);
+			expect((<HTMLElement>result.childNodes[0]).tagName).toBe('DIV');
+			expect((<HTMLElement>result.childNodes[0]).id).toBe('æøåÆØÅ');
+		});
+
 		it('Parses an entire HTML page.', () => {
 			const html = `
 	<!DOCTYPE html>
Repository: denoland/std (TypeScript)

Issue:
bug(toml): `parse` duplicates the character next to reserved escape sequences
**Describe the bug**

According to the [TOML spec](https://toml.io/en/v1.0.0#string), escape sequences that are not listed here are reserved:
```
\b         - backspace       (U+0008)
\t         - tab             (U+0009)
\n         - linefeed        (U+000A)
\f         - form feed       (U+000C)
\r         - carriage return (U+000D)
\"         - quote           (U+0022)
\\         - backslash       (U+005C)
\uXXXX     - unicode         (U+XXXX)
\UXXXXXXXX - unicode         (U+XXXXXXXX)
```

But when I parse a string that includes a reserved escape sequence, the parser duplicates the character next to it.

**Steps to Reproduce**

```ts
import { parse } from "https://deno.land/std@0.212.0/toml/mod.ts";

parse('a = "a\\0b"'); // { a: "abb" }
```

**Expected behavior**

There are 2 cases that I expected:

- Ignores the reserved escape sequence:
```ts
parse('a = "a\\0b"'); // { a: "ab" }
```

- Throws an error as specified in the spec:
> All other escape sequences not listed above are reserved; if they are used, TOML should produce an error.

**Environment**

<!-- please complete the following information -->

- OS:
- deno version: 1.39.3
- std version: 0.212.0



Discussion:

Patch:
diff --git a/toml/_parser.ts b/toml/_parser.ts
index e7f0f0af90a6..0107258f82f7 100644
--- a/toml/_parser.ts
+++ b/toml/_parser.ts
@@ -410,8 +410,9 @@ function EscapeSequence(scanner: Scanner): ParseResult<string> {
         scanner.next();
         return success("\\");
       default:
-        scanner.next();
-        return success(scanner.char());
+        throw new TOMLParseError(
+          `Invalid escape sequence: \\${scanner.char()}`,
+        );
     }
   } else {
     return failure();


Test patch:
diff --git a/toml/parse_test.ts b/toml/parse_test.ts
index b8f641af0ad7..8fd88d1b1100 100644
--- a/toml/parse_test.ts
+++ b/toml/parse_test.ts
@@ -61,6 +61,12 @@ Deno.test({
       'a"\n\t\b\\\あ🦕',
     );
     assertEquals(parse('""'), "");
+    assertEquals(parse('"a\\n"'), "a\n");
+    assertThrows(
+      () => parse('"a\\0b\\?c"'),
+      TOMLParseError,
+      "Invalid escape sequence: \\0",
+    );
     assertThrows(() => parse(""));
     assertThrows(() => parse('"a'));
     assertThrows(() => parse('"a\nb"'));
@@ -96,6 +102,16 @@ Violets are\\tblue"""`),
     """`),
       "The quick brown fox jumps over the lazy dog.",
     );
+    assertThrows(
+      () =>
+        parse(`"""\\
+    The quick brown \\
+    fox jumps over\\? \\
+    the lazy dog\\0.\\
+    """`),
+      TOMLParseError,
+      "Invalid escape sequence: \\?",
+    );
   },
 });
Repository: sindresorhus/type-fest (TypeScript)

Issue:
OverrideProperties doesn't throw an error if it has one correct property
I tried it in TypeScript 5.0.4.

```
type Foo = {
  a: string
  b: string
}

// It works well.
type Baz = OverrideProperties<Foo, {c: number}>

// It should throw an error, but it doesn't.
type Baz2 = OverrideProperties<Foo, {
  b: number
  c: number
}>
```


Discussion:

Patch:
diff --git a/source/override-properties.d.ts b/source/override-properties.d.ts
index 798c82cdf..1cbc05453 100644
--- a/source/override-properties.d.ts
+++ b/source/override-properties.d.ts
@@ -15,12 +15,15 @@ type Bar = OverrideProperties<Foo, {b: number}>
 //=> {a: string, b: number}
 
 type Baz = OverrideProperties<Foo, {c: number}>
-// error TS2559: Type '{c: number}' has no properties in common with type 'Partial{a: unknown; b: unknown}>'.
+// Error, type '{ c: number; }' does not satisfy the constraint '{ c: never; }'
+
+type Fizz = OverrideProperties<Foo, {b: number; c: number}>
+// Error, type '{ b: number; c: number; }' does not satisfy the constraint '{ b: number; c: never; }'
 ```
 
 @category Object
 */
 export type OverrideProperties<
 	TOriginal,
-	TOverride extends Partial<{[key in keyof TOriginal]: unknown}>,
+	TOverride extends {[Key in keyof TOverride]: Key extends keyof TOriginal ? TOverride[Key] : never},
 > = Merge<TOriginal, TOverride>;


Test patch:
diff --git a/test-d/override-properties.ts b/test-d/override-properties.ts
index 934314dd9..054e3c6c8 100644
--- a/test-d/override-properties.ts
+++ b/test-d/override-properties.ts
@@ -12,3 +12,7 @@ expectType<{a: number; b: number}>(fixture);
 expectError(() => {
     type Bar = OverrideProperties<Foo, {c: number}>;
 });
+
+expectError(() => {
+    type Bar = OverrideProperties<Foo, {b: number; c: number}>;
+});
Repository: sindresorhus/type-fest (TypeScript)

Issue:
`StringSlice<S, Start, End>` returns incorrect type when S is non-literal string
### Bug description

```ts
import type {StringSlice} from 'type-fest';

type Slice = StringSlice<string, 0, 1>; // string[]
```

https://github.com/sindresorhus/type-fest/blob/cfb594777f5ede903c151a45c2db250b057902d7/source/string-slice.d.ts#L29-L37

Line 34 should be modified to replace `string[]` with `string`.

### Repro

https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBDAnmApnA3gZRlYA7Ac0wBtgBjFAXzgDMoIQ4ByJVAWhpQGcYmBuALAAoYazQlyaALxxsuQhIoAeHvIIAaOAAZNARgB8goQEgA9KbgA9APzCzF1fgJxgXOCgAeqMjBQATTTwIeEdCAG0AXWEgA


Discussion:

Patch:
diff --git a/source/string-slice.d.ts b/source/string-slice.d.ts
index e610e8f0c..15b16bf43 100644
--- a/source/string-slice.d.ts
+++ b/source/string-slice.d.ts
@@ -31,7 +31,7 @@ export type StringSlice<
 	Start extends number = 0,
 	End extends number = StringToArray<S>['length'],
 > = string extends S
-	? string[]
+	? string
 	: ArraySlice<StringToArray<S>, Start, End> extends infer R extends readonly string[]
 		? Join<R, ''>
 		: never;


Test patch:
diff --git a/test-d/string-slice.ts b/test-d/string-slice.ts
index 6ac6244a2..4084a1bde 100644
--- a/test-d/string-slice.ts
+++ b/test-d/string-slice.ts
@@ -12,3 +12,6 @@ expectType<StringSlice<'abcde', -100, -3>>('ab');
 expectType<StringSlice<'abcde', 3, 100>>('de');
 expectType<StringSlice<'abcde', 1, 1>>('');
 expectType<StringSlice<'abcde', 100, 1>>('');
+expectType<StringSlice<string>>(null! as string);
+expectType<StringSlice<string, 1>>(null! as string);
+expectType<StringSlice<string, 1, 2>>(null! as string);
Repository: youzan/vant (TypeScript)

Issue:
[Bug Report] PickerGroup子组件渲染bug
### 重现链接

https://codesandbox.io/p/devbox/vant-4-picker-group-bug-pvm8hd

### Vant 版本

4.8.3

### 描述一下你遇到的问题。

重现链接中第一个PickerGroup是官网demo，第二个PickerGroup是问题代码，子组件用v-for渲染时展示不正确

### 重现步骤

见重现链接

### 设备/浏览器

_No response_


Discussion:

Patch:
diff --git a/packages/vant/src/picker-group/PickerGroup.tsx b/packages/vant/src/picker-group/PickerGroup.tsx
index 74bfac09548..efead8dc466 100644
--- a/packages/vant/src/picker-group/PickerGroup.tsx
+++ b/packages/vant/src/picker-group/PickerGroup.tsx
@@ -1,12 +1,15 @@
 import {
   defineComponent,
   Comment,
+  Fragment,
   type InjectionKey,
   type ExtractPropTypes,
+  type VNode,
 } from 'vue';
 
 // Utils
 import {
+  flat,
   pick,
   extend,
   makeArrayProp,
@@ -76,9 +79,20 @@ export default defineComponent({
     const onCancel = () => emit('cancel');
 
     return () => {
-      const childNodes = slots
+      let childNodes = slots
         .default?.()
-        ?.filter((node) => node.type !== Comment);
+        ?.filter((node) => node.type !== Comment)
+        .map((node) => {
+          if (node.type === Fragment) {
+            return node.children as VNode[];
+          }
+
+          return node;
+        });
+
+      if (childNodes) {
+        childNodes = flat(childNodes);
+      }
 
       const confirmButtonText = showNextButton()
         ? props.nextStepText
diff --git a/packages/vant/src/utils/basic.ts b/packages/vant/src/utils/basic.ts
index 10747d55d39..7912694a5fe 100644
--- a/packages/vant/src/utils/basic.ts
+++ b/packages/vant/src/utils/basic.ts
@@ -81,3 +81,6 @@ export const isSameValue = (newValue: unknown, oldValue: unknown) =>
 
 export const toArray = <T>(item: T | T[]): T[] =>
   Array.isArray(item) ? item : [item];
+
+export const flat = <T>(arr: Array<T | T[]>) =>
+  arr.reduce<T[]>((acc, val) => acc.concat(val), []);


Test patch:
diff --git a/packages/vant/src/picker-group/test/index.spec.tsx b/packages/vant/src/picker-group/test/index.spec.tsx
index 4922573c5ae..d441a5e1639 100644
--- a/packages/vant/src/picker-group/test/index.spec.tsx
+++ b/packages/vant/src/picker-group/test/index.spec.tsx
@@ -143,3 +143,25 @@ test('support controlled mode to set active-tab', async () => {
   await later();
   expect(tabs[1]?.classes()).toContain('van-tab--active');
 });
+
+test('should render correctly with v-for', async () => {
+  const Comp = {
+    components: {
+      Picker,
+      PickerGroup,
+    },
+    template: `
+      <picker-group :tabs="['Tab1', 'Tab2']">
+        <picker v-for="_ in 2" :columns="[{ text: '1', value: '1' }]" />
+      </picker-group>
+    `,
+  };
+
+  const wrapper = mount(Comp);
+  const items = wrapper.findAll('.van-swipe-item');
+
+  items.forEach((item) => {
+    const picker = item.find('.van-picker');
+    expect(picker.exists()).toEqual(true);
+  });
+});
Repository: refined-github/refined-github (TypeScript)

Issue:
Support `triage/bug` in `bugs-tab`
### Description

The feature https://github.com/refined-github/refined-github/blob/main/source/features/bugs-tab.tsx is extremely useful, but it seems to limit itself to "`bug`". It would be better if it could search for a few more variations (regex?). If not using some regex, could expected combinations be configurable?

For example, I have a few repositories I work on that use `triage/bug` or other similar variations to create some kind of "label grouping" like what GitLab offers. 

### Example URLs

https://github.com/ouranosinc/magpie (✔️ has "Bugs" tab, since `label:bug` exists https://github.com/Ouranosinc/Magpie/issues?q=is%3Aissue+is%3Aopen+label%3Abug)
https://github.com/crim-ca/weaver (❌ no "Bugs" tab, since `label:bug` not available https://github.com/crim-ca/weaver/issues?q=is%3Aissue+is%3Aopen+label%3Atriage%2Fbug)


Discussion:
We already do that, look at the first API query in that file. We can probably extend it to support slashes as well



Patch:
diff --git a/source/github-helpers/bugs-label.ts b/source/github-helpers/bugs-label.ts
index 1d8a9f512383..823131547a44 100644
--- a/source/github-helpers/bugs-label.ts
+++ b/source/github-helpers/bugs-label.ts
@@ -1,4 +1,4 @@
-const supportedLabels = /^(bug|bug-?fix|confirmed-bug|type[:/]bug|kind[:/]bug|(:[\w-]+:|\p{Emoji})bug)$/iu;
+const supportedLabels = /^(bug|bug-?fix|confirmed-bug|(type|kind|triage)[:/]bug|(:[\w-]+:|\p{Emoji})bug)$/iu;
 export default function isBugLabel(label: string): boolean {
 	return supportedLabels.test(label.replaceAll(/\s/g, ''));
 }


Test patch:
diff --git a/source/github-helpers/bugs-label.test.ts b/source/github-helpers/bugs-label.test.ts
index 34e65e1ab12c..e5ab0bd951a3 100644
--- a/source/github-helpers/bugs-label.test.ts
+++ b/source/github-helpers/bugs-label.test.ts
@@ -11,6 +11,8 @@ type/bug
 type:bug
 kind/bug
 kind:bug
+triage/bug
+triage:bug
 :bug:bug
 :bug: bug
 🐛bug
Repository: sindresorhus/got (TypeScript)

Issue:
Url not checked
#### Describe the bug

 - Node.js version: 20.12.1
 - OS & version: Windows 11 22631.3880

<!-- A clear and concise description of what the bug is. -->
Took me a few minutes to realise the nonsense error was caused by me passing the `false` output from a failing prior process.

#### Actual behavior

```
file:///[...]/got/dist/source/create.js:36
            request._noPipe = !normalized.isStream;
                                          ^

TypeError: Cannot read properties of undefined (reading 'isStream')
```

#### Expected behavior

```
TypeError: url must be a string
```

#### Code to reproduce

```js
import got from 'got';

await got(false);
```

<!--
We encourage you to submit a pull request with a failing test:
 - This will make it more likely for us to prioritize your issue.
 - It's a good way to prove that the issue is related to Got and not your code. 

Example: https://github.com/avajs/ava/blob/master/docs/01-writing-tests.md#failing-tests
-->

#### Checklist

- [x] I have read the documentation.
- [x] I have tried my code with the latest version of Node.js and Got.



Discussion:

Patch:
diff --git a/source/create.ts b/source/create.ts
index 7037cf223..46ea7501d 100644
--- a/source/create.ts
+++ b/source/create.ts
@@ -54,10 +54,10 @@ const create = (defaults: InstanceDefaults): Got => {
 		const lastHandler = (normalized: Options): GotReturn => {
 			// Note: `options` is `undefined` when `new Options(...)` fails
 			request.options = normalized;
-			request._noPipe = !normalized.isStream;
+			request._noPipe = !normalized?.isStream;
 			void request.flush();
 
-			if (normalized.isStream) {
+			if (normalized?.isStream) {
 				return request;
 			}
 
@@ -72,7 +72,7 @@ const create = (defaults: InstanceDefaults): Got => {
 
 			const result = handler(newOptions, iterateHandlers) as GotReturn;
 
-			if (is.promise(result) && !request.options.isStream) {
+			if (is.promise(result) && !request.options?.isStream) {
 				promise ||= asPromise(request);
 
 				if (result !== promise) {


Test patch:
diff --git a/test/arguments.ts b/test/arguments.ts
index 41b7034e2..b732ddb42 100644
--- a/test/arguments.ts
+++ b/test/arguments.ts
@@ -42,6 +42,16 @@ test('throws if the url option is missing', async t => {
 	});
 });
 
+test('throws if an invalid argument is passed', async t => {
+	await t.throwsAsync(
+		// @ts-expect-error Error tests
+		got(false),
+		{
+			instanceOf: RequestError,
+			message: 'Expected values which are `string`, `URL`, `Object`, or `undefined`. Received values of type `boolean`.',
+		});
+});
+
 test('throws an error if the protocol is not specified', async t => {
 	const error = await t.throwsAsync(got('example.com'));
 	invalidUrl(t, error!, 'example.com');
Repository: vuejs/pinia (TypeScript)

Issue:
define var storeToRefs(store) HMR not work as expected
### Reproduction

https://stackblitz.com/edit/github-k5deut?file=src%2Fstores%2Fcart.ts,src%2FApp.vue,src%2Fstores%2Fuser.ts

### Steps to reproduce the bug

Open src/stores/cart.ts
Change 
```
 test(state) {
    return state.totalNum + 1005;
  }
```
Check log
![image](https://github.com/user-attachments/assets/71496990-be8f-4de0-9e89-1b55d22ee77a)


```App.vue
    const cart = useCartStore();
    const { test } = storeToRefs(cart);
    const testStoreToRefs = storeToRefs(cart)
    watchEffect(() => {
      console.log(
        cart.test,
        test.value,
        testStoreToRefs.test.value,
        storeToRefs(cart).test.value,
        storeToRefs(cart).test
      );
    });
```

### Expected behavior

when use 
```
    const { test } = storeToRefs(cart);
    const testStoreToRefs = storeToRefs(cart)
```
change file src/stores/cart.ts,   HMR should work as  cart.test(or storeToRefs(cart).test.value or storeToRefs(cart).test)

### Actual behavior

when use 
```
    const { test } = storeToRefs(cart);
    const testStoreToRefs = storeToRefs(cart)
```
change file src/stores/cart.ts,   HMR not work as expected

### Additional information

_No response_


Discussion:

Patch:
diff --git a/packages/pinia/src/storeToRefs.ts b/packages/pinia/src/storeToRefs.ts
index 9e5dab0e4b..3a1cec09f5 100644
--- a/packages/pinia/src/storeToRefs.ts
+++ b/packages/pinia/src/storeToRefs.ts
@@ -94,11 +94,11 @@ export function storeToRefs<SS extends StoreGeneric>(
     // @ts-expect-error: toRefs include methods and others
     return toRefs(store)
   } else {
-    store = toRaw(store)
+    const rawStore = toRaw(store)
 
     const refs = {} as StoreToRefs<SS>
-    for (const key in store) {
-      const value = store[key]
+    for (const key in rawStore) {
+      const value = rawStore[key]
       if (isRef(value) || isReactive(value)) {
         // @ts-expect-error: the key is state or getter
         refs[key] =


Test patch:
diff --git a/packages/pinia/__tests__/storeToRefs.spec.ts b/packages/pinia/__tests__/storeToRefs.spec.ts
index d7e6a5f2f6..d1110e8c13 100644
--- a/packages/pinia/__tests__/storeToRefs.spec.ts
+++ b/packages/pinia/__tests__/storeToRefs.spec.ts
@@ -1,6 +1,7 @@
 import { describe, beforeEach, it, expect } from 'vitest'
 import { computed, reactive, ref, ToRefs } from 'vue'
 import { createPinia, defineStore, setActivePinia, storeToRefs } from '../src'
+import { set } from 'vue-demi'
 
 describe('storeToRefs', () => {
   beforeEach(() => {
@@ -170,6 +171,25 @@ describe('storeToRefs', () => {
     expect(refs.n.value).toBe(2)
   })
 
+  it('keep reactivity', () => {
+    const store = defineStore('a', () => {
+      const n = ref(0)
+      const double = computed(() => n.value * 2)
+      return { n, double }
+    })()
+
+    const { double } = storeToRefs(store)
+
+    // Assuming HMR operation
+    set(
+      store,
+      'double',
+      computed(() => 1)
+    )
+
+    expect(double.value).toEqual(1)
+  })
+
   tds(() => {
     const store1 = defineStore('a', () => {
       const n = ref(0)
Repository: honojs/hono (TypeScript)

Issue:
Decode URL params
Since query params are passed in the URL, the data is encoded (e.g. `@` becomes `%40`).

This breaks the **validators** in cases like having a Regex to validate an email.

Also the data received in the **handlers** is encoded.

### Current Behavior
```ts
const query = c.req.valid('query')
// { email: 'example%40gmail.com' }
```

### Expected Behavior
```ts
const query = c.req.valid('query')
// { email: 'example@gmail.com' }
```


Discussion:
Hi @sergiocarneiro !

Thanks for creating the issue. I've released the new version `v3.1.3`, which includes the change to resolve this issue. Try it!
Hi @yusukebe. Looks good, thanks! 👏



Patch:
diff --git a/src/utils/url.ts b/src/utils/url.ts
index 2164cda0b..11050ed0e 100644
--- a/src/utils/url.ts
+++ b/src/utils/url.ts
@@ -155,7 +155,7 @@ export const getQueryParam = (
       const v = strings.substring(eqIndex + 1)
       const k = strings.substring(0, eqIndex)
       if (key === k) {
-        return /\%/.test(v) ? decodeURI(v) : v
+        return /\%/.test(v) ? decodeURIComponent(v) : v
       } else {
         results[k] ||= v
       }
@@ -181,7 +181,7 @@ export const getQueryParams = (
     let [k, v] = strings.split('=')
     if (v === undefined) v = ''
     results[k] ||= []
-    results[k].push(v.indexOf('%') !== -1 ? decodeURI(v) : v)
+    results[k].push(v.indexOf('%') !== -1 ? decodeURIComponent(v) : v)
   }
 
   if (key) return results[key] ? results[key] : null


Test patch:
diff --git a/src/request.test.ts b/src/request.test.ts
index 469e38f66..c631c99f0 100644
--- a/src/request.test.ts
+++ b/src/request.test.ts
@@ -1,10 +1,10 @@
 import { HonoRequest } from './request'
 
 describe('Query', () => {
-  const rawRequest = new Request('http://localhost?page=2&tag=A&tag=B')
-  const req = new HonoRequest(rawRequest)
-
   test('req.query() and req.queries()', () => {
+    const rawRequest = new Request('http://localhost?page=2&tag=A&tag=B')
+    const req = new HonoRequest(rawRequest)
+
     const page = req.query('page')
     expect(page).not.toBeUndefined()
     expect(page).toBe('2')
@@ -19,6 +19,17 @@ describe('Query', () => {
     const q2 = req.queries('q2')
     expect(q2).toBeUndefined()
   })
+
+  test('decode special chars', () => {
+    const rawRequest = new Request('http://localhost?mail=framework%40hono.dev&tag=%401&tag=%402')
+    const req = new HonoRequest(rawRequest)
+
+    const mail = req.query('mail')
+    expect(mail).toBe('framework@hono.dev')
+
+    const tags = req.queries('tag')
+    expect(tags).toEqual(['@1', '@2'])
+  })
 })
 
 describe('req.addValidatedData() and req.data()', () => {
Repository: garmeeh/next-seo (TypeScript)

Issue:
No worstRating under AggregateRating json ld
**Describe the bug**
No worstRating under AggregateRating json ld

**Reproduction**
Based on ld json schema, AggregateRating should have worstRating which is missing next-seo

Schema:
https://schema.org/AggregateRating

Github for next-seo types missing worstRating
https://github.com/garmeeh/next-seo/blob/d96d58dc093d0cdf5f24e059e509ae6234b353cc/src/types.ts#L350

**Expected behavior**
worstRating under AgggregateRating


**Additional context**
none



Discussion:

Patch:
diff --git a/README.md b/README.md
index 96140b0b..4889187d 100644
--- a/README.md
+++ b/README.md
@@ -2255,6 +2255,7 @@ const Page = () => (
         reviewCount: '89',
         ratingCount: '684',
         bestRating: '100',
+        worstRating: '1',
       }}
       reviews={[
         {
@@ -3177,6 +3178,7 @@ export default () => (
 | `aggregateRating.ratingCount` | The count of total number of ratings.                                                    |
 | `aggregateRating.reviewCount` | The count of total number of reviews.                                                    |
 | `aggregateRating.bestRating`  | The highest value allowed in this rating system. If bestRating is omitted, 5 is assumed. |
+| `aggregateRating.worstRating` | The lowest value allowed in this rating system. If worstRating is omitted, 1 is assumed. |
 
 **Other**
 | `useAppDir` | This should be set to true if using new app directory. Not required if outside of app directory. |
diff --git a/src/types.ts b/src/types.ts
index a92f3624..c3337416 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -359,6 +359,7 @@ export type AggregateRating = {
   reviewCount?: string;
   ratingCount?: string;
   bestRating?: string;
+  worstRating?: string;
 };
 
 export type GamePlayMode = 'CoOp' | 'MultiPlayer' | 'SinglePlayer';
diff --git a/src/utils/schema/setAggregateRating.ts b/src/utils/schema/setAggregateRating.ts
index 31b1b729..72553c14 100644
--- a/src/utils/schema/setAggregateRating.ts
+++ b/src/utils/schema/setAggregateRating.ts
@@ -8,6 +8,7 @@ export function setAggregateRating(aggregateRating?: AggregateRating) {
       reviewCount: aggregateRating.reviewCount,
       bestRating: aggregateRating.bestRating,
       ratingValue: aggregateRating.ratingValue,
+      worstRating: aggregateRating.worstRating,
     };
   }
   return undefined;


Test patch:
diff --git a/src/utils/schema/__tests__/setAggregateRating.test.ts b/src/utils/schema/__tests__/setAggregateRating.test.ts
index 5820e2e1..bc620f00 100644
--- a/src/utils/schema/__tests__/setAggregateRating.test.ts
+++ b/src/utils/schema/__tests__/setAggregateRating.test.ts
@@ -6,6 +6,7 @@ const aggregateRating: AggregateRating = {
   reviewCount: '100',
   ratingCount: '100',
   bestRating: '5',
+  worstRating: '1',
 };
 
 describe('setAggregateOffer', () => {
Repository: honojs/hono (TypeScript)

Issue:
Using Context.status() does not work when using Context.text()
### What version of Hono are you using?

3.10.0

### What runtime/platform is your app running on?

Deno

### What steps can reproduce the bug?

```ts
import { Hono } from "https://deno.land/x/hono@v3.10.0/mod.ts";

const app = new Hono();

app.get("/", (c) => {
  c.status(403);
  return c.text("Message received!");
});

Deno.serve(app.fetch);

```

### What is the expected behavior?

The status code should be 403.

### What do you see instead?

It is 200.

### Additional information

Other responses work good.

```ts
import { Hono } from "https://deno.land/x/hono@v3.10.0/mod.ts";

const app = new Hono();

app.get("/", (c) => {
  c.status(403);
  return c.html("<h1>Message received!</h1>");
});

Deno.serve(app.fetch);
```

It returns 403 status code.


Discussion:
Hi @sant123,

Thank you for raising the issue and creating the PR.

Your PR is good, but I've created another PR, #1702, with a different approach to fix this.

My PR offers a slightly faster performance compared to the app with your PR. Therefore, I'll merge #1702. Thanks!



Patch:
diff --git a/deno_dist/context.ts b/deno_dist/context.ts
index d4b498ab7..741202ce3 100644
--- a/deno_dist/context.ts
+++ b/deno_dist/context.ts
@@ -214,6 +214,7 @@ export class Context<
   }
 
   status = (status: StatusCode): void => {
+    this._init = false
     this._status = status
   }
 
diff --git a/src/context.ts b/src/context.ts
index 0dceb2e11..6aec81d07 100644
--- a/src/context.ts
+++ b/src/context.ts
@@ -214,6 +214,7 @@ export class Context<
   }
 
   status = (status: StatusCode): void => {
+    this._init = false
     this._status = status
   }
 


Test patch:
diff --git a/src/context.test.ts b/src/context.test.ts
index 84956bf57..193f03c4c 100644
--- a/src/context.test.ts
+++ b/src/context.test.ts
@@ -17,6 +17,14 @@ describe('Context', () => {
     expect(res.headers.get('X-Custom')).toBe('Message')
   })
 
+  it('c.text() with c.status()', async () => {
+    c.status(404)
+    const res = c.text('not found')
+    expect(res.status).toBe(404)
+    expect(res.headers.get('Content-Type')).toMatch(/^text\/plain/)
+    expect(await res.text()).toBe('not found')
+  })
+
   it('c.json()', async () => {
     const res = c.json({ message: 'Hello' }, 201, { 'X-Custom': 'Message' })
     expect(res.status).toBe(201)
Repository: golevelup/nestjs (TypeScript)

Issue:
RabibtMQ: New URI validation is breaking uri's with / in the virtual host  
Related to this [issue](https://github.com/golevelup/nestjs/issues/873).

Our virtual host includes `/` in the name, however the latest version 5.6.0 [introduced](https://github.com/golevelup/nestjs/blob/c47cc5b833c88bbe3d3c8b41e37de2c109603b1f/packages/rabbitmq/src/amqp/utils.ts#L31) a validation of the URL which fails if there's a `/` after the vhost one.

Example URI: `amqp://guest:guest@localhost:5672//my_virtual_host`


Discussion:
@PavelPashov Are you able to help by adding this scenario on the parser/test case? 
This was a long-standing request that I've made initially but I'm pretty sure the vhost slipped :sweat_smile: 



Patch:
diff --git a/packages/rabbitmq/src/amqp/utils.ts b/packages/rabbitmq/src/amqp/utils.ts
index b3301095c..792608fb2 100644
--- a/packages/rabbitmq/src/amqp/utils.ts
+++ b/packages/rabbitmq/src/amqp/utils.ts
@@ -29,7 +29,7 @@ export function matchesRoutingKey(
 }
 
 const rabbitMQRegex =
-  /^amqps?:\/\/(([^:]+):([^@]+)@)?([^:/]+)(:[0-9]+)?(\/[^\/]*)?$/;
+  /^amqps?:\/\/(([^:]+):([^@]+)@)?([^:/]+)(:[0-9]+)?(\/.*)?$/;
 
 /**
  * Validates a rabbitmq uri


Test patch:
diff --git a/packages/rabbitmq/src/tests/rabbitmq.utils.spec.ts b/packages/rabbitmq/src/tests/rabbitmq.utils.spec.ts
index 4bf17e7de..3f6f3e3c5 100644
--- a/packages/rabbitmq/src/tests/rabbitmq.utils.spec.ts
+++ b/packages/rabbitmq/src/tests/rabbitmq.utils.spec.ts
@@ -72,6 +72,8 @@ describe(matchesRoutingKey.name, () => {
           'amqps://rabbitmq:rabbitmq@localhost:2345',
           'amqp://rabbitmq:rabbitmq@localhost:3456/',
           'amqps://rabbitmq:rabbitmq@localhost:4567/',
+          'amqps://rabbitmq:rabbitmq@localhost:4567/vhost',
+          'amqps://rabbitmq:rabbitmq@localhost:4567/v/h(o&s*t_',
         ]),
       ).not.toThrowError();
     });
Repository: denoland/std (TypeScript)

Issue:
`text/unstable-dedent` gives poor results when interpolating multi-line text into tagged template
**Describe the bug**

**Steps to Reproduce**

```ts
import { dedent } from 'jsr:@std/text@1.0.13/unstable-dedent'
import { assertEquals } from 'jsr:@std/assert'
const inner = dedent`
    2
    3
`
assertEquals(inner, '2\n3') // ok
const outer = dedent`
    1
    ${inner}
    4
`
assertEquals(outer, '1\n2\n3\n4') // throws
```

**Diff**

```diff
- Actual
+ Expected

-     1
-     2
+ 1
+ 2
  3
-     4
+ 4
```

This looks to be because the interpolated values aren't differentiated from the template parts when calculating minimum common indentation to strip.

For comparison, the `npm:string-dedent` template function (unofficial [`String.dedent`](https://github.com/tc39/proposal-string-dedent/) polyfill) gives the expected result.

**Environment**

text@1.0.13



Discussion:

Patch:
diff --git a/text/unstable_dedent.ts b/text/unstable_dedent.ts
index 5f1907b540f8..e31a4790d59b 100644
--- a/text/unstable_dedent.ts
+++ b/text/unstable_dedent.ts
@@ -62,12 +62,11 @@ export function dedent(
   input: TemplateStringsArray | string,
   ...values: unknown[]
 ): string {
-  const inputString = typeof input === "string"
-    ? input
-    : String.raw({ raw: input }, ...values);
-  const ignoreFirstUnindented = !inputString.startsWith("\n");
-  const trimmedInput = inputString.replace(/^\n/, "").trimEnd();
-  const lines = trimmedInput.split("\n");
+  // Substitute nonempty placeholder so multiline substitutions do not affect indent width.
+  const joinedTemplate = typeof input === "string" ? input : input.join("x");
+  const ignoreFirstUnindented = !joinedTemplate.startsWith("\n");
+  const trimmedTemplate = joinedTemplate.replace(/^\n/, "").trimEnd();
+  const lines = trimmedTemplate.split("\n");
 
   let minIndentWidth: number | undefined = undefined;
   for (let i = 0; i < lines.length; i++) {
@@ -87,6 +86,11 @@ export function dedent(
     }
   }
 
+  const inputString = typeof input === "string"
+    ? input
+    : String.raw({ raw: input }, ...values);
+  const trimmedInput = inputString.replace(/^\n/, "").trimEnd();
+
   // No lines to indent
   if (minIndentWidth === undefined || minIndentWidth === 0) {
     return trimmedInput;


Test patch:
diff --git a/text/unstable_dedent_test.ts b/text/unstable_dedent_test.ts
index c7d009cd21ae..117341842a41 100644
--- a/text/unstable_dedent_test.ts
+++ b/text/unstable_dedent_test.ts
@@ -69,3 +69,12 @@ Deno.test("dedent() handles one line", () => {
     "one line",
   );
 });
+
+Deno.test("dedent() handles multiline substitution", () => {
+  const outer = dedent`
+    1
+    ${"2\n3"}
+    4
+`;
+  assertEquals(outer, "1\n2\n3\n4");
+});
Repository: elysiajs/elysia (TypeScript)

Issue:
[BUG] [Easy Fix] Incorrect Error Code Returned when Throwing InternalServerError
### Current Behavior:

When throwing an InternalServerError anywhere in the code and logging it inside the onError function, the error code returned is "NOT_FOUND" instead of the expected "INTERNAL_SERVER_ERROR." This behavior is inconsistent with other error codes, which work correctly.

### Expected Behavior:

The expected behavior is that when throwing an InternalServerError, the error code should be "INTERNAL_SERVER_ERROR" as it accurately reflects the nature of the error.

### Steps to Reproduce:

In your codebase, throw an InternalServerError using the relevant method or class.
Implement an onError function or handler.
Inside the onError function, log the error and its code using console.log(error, code);.
Observe that the error code logged is "NOT_FOUND" instead of "INTERNAL_SERVER_ERROR."
Additional Context:

This issue affects the accuracy and consistency of error handling within the codebase. It can lead to confusion and misinterpretation of error codes by developers and systems relying on this code. It's essential to resolve this issue to ensure proper error reporting and debugging capabilities.

### Possible Solution:

To resolve this issue, you should review the code responsible for handling error codes and ensure that when an InternalServerError is thrown, the correct code "INTERNAL_SERVER_ERROR" is assigned. This may involve inspecting the code related to error classes and their mappings to error codes.


Discussion:

Patch:
diff --git a/src/error.ts b/src/error.ts
index e6a37807..8d7320fa 100644
--- a/src/error.ts
+++ b/src/error.ts
@@ -20,7 +20,7 @@ export type ElysiaErrors =
 	| ValidationError
 
 export class InternalServerError extends Error {
-	code = 'NOT_FOUND'
+	code = 'INTERNAL_SERVER_ERROR'
 	status = 500
 
 	constructor() {


Test patch:
diff --git a/test/error.test.ts b/test/error.test.ts
index 34a12541..aa2ac8a0 100644
--- a/test/error.test.ts
+++ b/test/error.test.ts
@@ -1,4 +1,4 @@
-import { Elysia, t } from '../src'
+import { Elysia, InternalServerError, t } from '../src'
 import { describe, expect, it } from 'bun:test'
 import { post, req } from './utils'
 
@@ -48,4 +48,21 @@ describe('error', () => {
 		expect(data.length).toBe(4)
 		expect(res.status).toBe(400)
 	})
+
+	it('custom 500', async () => {
+		const app = new Elysia()
+			.onError(({ code }) => {
+				if (code === 'INTERNAL_SERVER_ERROR') {
+					return 'UwU'
+				}
+			})
+			.get('/', () => {
+				throw new InternalServerError()
+			})
+
+		const response = await app.handle(req('/'))
+
+		expect(await response.text()).toBe('UwU')
+		expect(response.status).toBe(500)
+	})
 })
Repository: denoland/std (TypeScript)

Issue:
SemVer: Method returning boolean for validation
I used to use `semver.valid` to check if a string is a valid semver. Since the deprecation of the old library, is there a similar method which returns a boolean? I prefer Booleans compared to TypeErrors, what `semver.parse` throws.

If not, can we add one?

Thank you!


Discussion:
This seems logical to me. [`URL.canParse`](https://developer.mozilla.org/en-US/docs/Web/API/URL/canParse_static) is precedent that this sort of API makes sense.



Patch:
diff --git a/semver/can_parse.ts b/semver/can_parse.ts
new file mode 100644
index 000000000000..beb3449361d5
--- /dev/null
+++ b/semver/can_parse.ts
@@ -0,0 +1,15 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+import { SemVer } from "./types.ts";
+import { parse } from "./parse.ts";
+
+export function canParse(version: string | SemVer) {
+  try {
+    parse(version);
+    return true;
+  } catch (err) {
+    if (!(err instanceof TypeError)) {
+      throw err;
+    }
+    return false;
+  }
+}


Test patch:
diff --git a/semver/can_parse_test.ts b/semver/can_parse_test.ts
new file mode 100644
index 000000000000..8497c36d8c0e
--- /dev/null
+++ b/semver/can_parse_test.ts
@@ -0,0 +1,40 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+import { assertEquals } from "../assert/mod.ts";
+import { canParse } from "./can_parse.ts";
+
+Deno.test("[semver] canParse", async (t) => {
+  // deno-lint-ignore no-explicit-any
+  const versions: [any, boolean][] = [
+    ["1.2.3", true],
+    [" 1.2.3 ", true],
+    [" 2.2.3-4 ", true],
+    [" 3.2.3-pre ", true],
+    ["v5.2.3", true],
+    [" v8.2.3 ", true],
+    ["\t13.2.3", true],
+    ["1.2." + new Array(256).join("1"), false], // too long
+    ["1.2." + new Array(100).join("1"), false], // too big
+    [null, false],
+    [undefined, false],
+    [{}, false],
+    [[], false],
+    [false, false],
+    [true, false],
+    [0, false],
+    ["", false],
+    ["not a version", false],
+    ["∞.∞.∞", false],
+    ["NaN.NaN.NaN", false],
+    ["1.2.3.4", false],
+    ["NOT VALID", false],
+    [1.2, false],
+    [null, false],
+    ["Infinity.NaN.Infinity", false],
+  ];
+
+  for (const [v, expected] of versions) {
+    await t.step(`${v}`, () => {
+      assertEquals(canParse(v), expected);
+    });
+  }
+});