@rstack-dev/doc-ui
Advanced tools
@@ -240,7 +240,26 @@ import './index.css'; | ||
| const getClassName = (...classNames)=>classNames.filter(Boolean).join(' '); | ||
| const ISO_DATE_PREFIX_RE = /^(\d{4})-(\d{2})-(\d{2})(?:$|[T\s])/; | ||
| const getDatePartsFromString = (value)=>{ | ||
| const match = ISO_DATE_PREFIX_RE.exec(value.trim()); | ||
| if (!match) return; | ||
| const [, year, month, day] = match; | ||
| return { | ||
| year: Number(year), | ||
| month: Number(month), | ||
| day: Number(day) | ||
| }; | ||
| }; | ||
| const normalizeDate = (value)=>{ | ||
| if (void 0 === value) return; | ||
| const date = value instanceof Date ? value : new Date(value); | ||
| const date = value instanceof Date ? value : 'string' == typeof value ? new Date(value) : new Date(value); | ||
| return Number.isNaN(date.getTime()) ? void 0 : date; | ||
| }; | ||
| const formatBlogDate = (value, formatter)=>{ | ||
| if ('string' == typeof value) { | ||
| const dateParts = getDatePartsFromString(value); | ||
| if (dateParts) return formatter.format(new Date(dateParts.year, dateParts.month - 1, dateParts.day)); | ||
| } | ||
| const date = normalizeDate(value); | ||
| return date ? formatter.format(date) : void 0; | ||
| }; | ||
| const getPostKey = (post, index)=>{ | ||
@@ -283,3 +302,3 @@ if (void 0 !== post.id) return post.id; | ||
| function BlogCard({ post, isFeatured, Link, dateFormatter, interactive, renderInlineMarkdown }) { | ||
| const normalizedDate = normalizeDate(post.date); | ||
| const formattedDate = formatBlogDate(post.date, dateFormatter); | ||
| const isInteractive = interactive && Boolean(post.href); | ||
@@ -294,5 +313,5 @@ const hasTitle = hasContent(post.title); | ||
| children: [ | ||
| normalizedDate ? /*#__PURE__*/ jsx("span", { | ||
| formattedDate ? /*#__PURE__*/ jsx("span", { | ||
| className: index_module.date, | ||
| children: dateFormatter.format(normalizedDate) | ||
| children: formattedDate | ||
| }) : null, | ||
@@ -299,0 +318,0 @@ hasTitle ? /*#__PURE__*/ jsx("div", { |
+1
-1
| { | ||
| "name": "@rstack-dev/doc-ui", | ||
| "version": "1.13.1", | ||
| "version": "1.13.2", | ||
| "type": "module", | ||
@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts", |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1761008
0.04%40907
0.05%