Comments (3)
This issue belongs in https://github.com/denoland/deno_std
from deno_std.
This seems to have started from #4189
The example test case passes with [email protected]
(and fails with [email protected]
):
import { parseArgs } from "https://deno.land/[email protected]/cli/parse_args.ts";
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts";
Deno.test("collect with alias", () => {
const args = ["--header", "abc", "--header", "def"];
const parsed = parseArgs(args, {
collect: ["header"],
alias: {
H: "header",
},
});
assertEquals(parsed.header, ["abc", "def"])
})
I'd suggest we should revert #4189
from deno_std.
I think I found the bug. The aliasMap
Set for key
contains key
itself. On that example header
contains header
as an alias.
Map(2) {
"H" => Set(1) { "header" },
"header" => Set(2) { "H", "header" }
}
This is fixed by filtering out the key.
before:
const set = new Set([key, ...aliases]);
aliases.forEach((alias) => aliasMap.set(alias, set));
after:
aliases.forEach((alias) => aliasMap.set(alias, new Set([key, ...aliases.filter((it) => it !== alias)])));
from deno_std.
Related Issues (20)
- bug(http): missing docs and `setCookie()` allows `Max-age` to be 0 HOT 8
- bug: `unable to analyze dynamic import` in `@std/testing/snapshot` HOT 3
- Failed to publish @std/expect to local jsr HOT 3
- suggestion: enable `no-sync-fn-in-async-fn` linting rule HOT 1
- suggestion: enable `single-var-declarator` linting rule
- flaky test failure on macOS with the error message `error: second time provided was later than self` HOT 4
- Unknown export '.' for @std/[email protected] HOT 3
- bug: leak detected in `Tar() checks directory entry type` test
- const `stat` of `fs/exists.ts`:69 is incorrect when running `check_mod_exports.ts`
- suggestion: `concatReadableStreams()` HOT 16
- suggestion: deprecate `std/encoding/varint` HOT 5
- YAML `stringify()` speciously restricts input type to `Record<string, unknown>`
- Bug: expect comparing `RegExp` and `Set` is wrong HOT 1
- bug: type error when using it.skip from @std/testing/bdd on jsr.io HOT 1
- Add CI stages that use DENO_FUTURE=1 HOT 4
- Suggestion: Normalize HTML/XML entities
- The web doc of `[email protected]/path` downloads the .ts files instead of showing documentation HOT 2
- web doc for `[email protected]/collections` missing HOT 3
- feature: add synchronization primitives ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deno_std.