Title: Suggestion: Regex-validated string type · Issue #6579 · microsoft/TypeScript · GitHub
Open Graph Title: Suggestion: Regex-validated string type · Issue #6579 · microsoft/TypeScript
X Title: Suggestion: Regex-validated string type · Issue #6579 · microsoft/TypeScript
Description: There are cases, where a property can not just be any string (or a set of strings), but needs to match a pattern. let fontStyle: 'normal' | 'italic' = 'normal'; // already available in master let fontColor: /^#([0-9a-f]{3}|[0-9a-f]{6})$/...
Open Graph Description: There are cases, where a property can not just be any string (or a set of strings), but needs to match a pattern. let fontStyle: 'normal' | 'italic' = 'normal'; // already available in master let f...
X Description: There are cases, where a property can not just be any string (or a set of strings), but needs to match a pattern. let fontStyle: 'normal' | 'italic' = 'normal'; // already a...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/6579
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Suggestion: Regex-validated string type","articleBody":"There are cases, where a property can not just be any string (or a set of strings), but needs to match a pattern.\n\n``` typescript\nlet fontStyle: 'normal' | 'italic' = 'normal'; // already available in master\nlet fontColor: /^#([0-9a-f]{3}|[0-9a-f]{6})$/i = '#000'; // my suggestion\n```\n\nIt's common practice in JavaScript to store color values in css notation, such as in the css style reflection of DOM nodes or various 3rd party libraries.\n\nWhat do you think?\n","author":{"url":"https://github.com/tenry92","@type":"Person","name":"tenry92"},"datePublished":"2016-01-22T22:50:35Z","url":"https://github.com/microsoft/TypeScript/issues/6579"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b97885c8-f989-9deb-43ea-f1e47f71218f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C94E:10FCF3:16DA87:20D369:6AFBFF7B |
| html-safe-nonce | d411102e8be46a2a9dd78e0315abd65c87d19d6827933841359ce1420bd8b8d2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTRFOjEwRkNGMzoxNkRBODc6MjBEMzY5OjZBRkJGRjdCIiwidmlzaXRvcl9pZCI6Ijc2Mjk2NTY2NzM2Mjg5Nzc4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a5d12bc0b48a80cebc2428c03794cbafa2412914183b9dde919fb4fcc405b4dc |
| hovercard-subject-tag | issue:128264906 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/6579/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2b97135a1d65f39cb805cea43c696c9c344c2d28fa8834cb93ce6eaf2e76cc9d/microsoft/TypeScript/issues/6579 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2b97135a1d65f39cb805cea43c696c9c344c2d28fa8834cb93ce6eaf2e76cc9d/microsoft/TypeScript/issues/6579 |
| og:image:alt | There are cases, where a property can not just be any string (or a set of strings), but needs to match a pattern. let fontStyle: 'normal' | 'italic' = 'normal'; // already available in master let f... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tenry92 |
| hostname | github.com |
| expected-hostname | github.com |
| None | fa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b3b5633a74535d9c23385512d534c66c8fde1907 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width