pillarjs/path-to-regexp — 8.6k★ trên GitHub (TypeScript). Turn a path string such as `/user/:name` into a regular expression
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Parameters match arbitrary strings in a path by matching up to the end of the segment, or up to any proceeding tokens. They are defined by prefixing a colon to the parameter name (:foo). Parameter names can use any valid JavaScript identifier, or be double quoted to use other characters (:"param-name").
Wildcard parameters match one or more characters across multiple segments. They are defined the same way as regular parameters, but are prefixed with an asterisk (*foo).
The match function returns a function for matching strings against a path:
path String, TokenData object, or array of strings and TokenData objects.
options(optional) (Extends pathToRegexp options)
decode Function for decoding strings to params, or false to disable all processing. (default: decodeURIComponent)
const fn = match("/foo/:bar");
Please note:path-to-regexp is intended for ordered data (e.g. paths, hosts). It can not handle arbitrarily ordered data (e.g. query strings, URL fragments, JSON, etc).
PathToRegexp
The pathToRegexp function returns the regexp for matching strings against paths, and an array of keys for understanding the RegExp#exec matches.
path String, TokenData object, or array of strings and TokenData objects.
options(optional) (See parse for more options)
sensitive Regexp will be case sensitive. (default: false)
end Validate the match reaches the end of the string. (default: true)
delimiter The default delimiter for segments, e.g. [^/] for :named parameters. (default: '/')
trailing Allows optional trailing delimiter to match. (default: true)
An effort has been made to ensure ambiguous paths from previous releases throw an error. This means you might be seeing an error when things worked before.
Missing parameter name
Parameter names must be provided after : or *, for example /*path. They can be valid JavaScript identifiers (e.g. :myName) or JSON strings (:"my-name").
Unexpected ? or +
In past releases, ?, *, and + were used to denote optional or repeating parameters. As an alternative, try these:
For optional (?), use braces: /file{.:ext}.
For one or more (+), use a wildcard: /*path.
For zero or more (*), use both: /files{/*path}.
Unexpected (, ), [, ], etc.
Previous versions of Path-to-RegExp used these for RegExp features. This version no longer supports them so they've been reserved to avoid ambiguity. To match these characters literally, escape them with a backslash, e.g. "\\(".
Unterminated quote
Parameter names can be wrapped in double quote characters, and this error means you forgot to close the quote character. For example, :"foo.
Express <= 4.x
Path-To-RegExp breaks compatibility with Express <= 4.x in the following ways:
The wildcard * must have a name and matches the behavior of parameters :.
The optional character ? is no longer supported, use braces instead: /:file{.:ext}.
Regexp characters are not supported.
Some characters have been reserved to avoid confusion during upgrade (()[]?+!).
Parameter names now support valid JavaScript identifiers, or quoted like :"this".
pillarjs/path-to-regexp thuộc nhóm Backend trên TopGit, cùng 4 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về pillarjs/path-to-regexp ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/pillarjs/path-to-regexp là nguồn chính thức.
pillarjs/path-to-regexp có bao nhiêu sao?
pillarjs/path-to-regexp có 8.6k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/pillarjs/path-to-regexp. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
pillarjs/path-to-regexp có phải mã nguồn mở không?
Có — pillarjs/path-to-regexp phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/pillarjs/path-to-regexp.
pillarjs/path-to-regexp còn đang phát triển không?
Commit gần nhất trên pillarjs/path-to-regexp là 19 ngày trước (theo timestamp GitHub). Repo có 484 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
pillarjs/path-to-regexp dùng license gì?
pillarjs/path-to-regexp phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
pillarjs/path-to-regexp là gì?
pillarjs/path-to-regexp (pillarjs/path-to-regexp) là dự án TypeScript trên GitHub. Theo mô tả gốc: Turn a path string such as `/user/:name` into a regular expression
pillarjs/path-to-regexp viết bằng ngôn ngữ gì?
pillarjs/path-to-regexp chủ yếu viết bằng TypeScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về path-to-regexp?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về path-to-regexp.