File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,9 @@ PromotionGatePanel.js
88import { drawPanel } from '../DebugPanel.js' ;
99
1010function asObject ( value ) {
11- return value && typeof value === 'object' && ! Array . isArray ( value ) ? value : { } ;
11+ return value && typeof value === 'object' && ! Array . isArray ( value )
12+ ? value
13+ : { } ;
1214}
1315
1416function resolvePromotionStatus ( source ) {
Original file line number Diff line number Diff line change 1+
2+
3+ export function escapeHtml ( value ) {
4+ return String ( value || "" )
5+ . replaceAll ( "&" , "&" )
6+ . replaceAll ( "<" , "<" )
7+ . replaceAll ( ">" , ">" )
8+ . replaceAll ( '"' , """ )
9+ . replaceAll ( "'" , "'" ) ;
10+ }
Original file line number Diff line number Diff line change 11import { getToolRegistry } from "./toolRegistry.js" ;
2-
3- function escapeHtml ( value ) {
4- return String ( value || "" )
5- . replaceAll ( "&" , "&" )
6- . replaceAll ( "<" , "<" )
7- . replaceAll ( ">" , ">" )
8- . replaceAll ( '"' , """ )
9- . replaceAll ( "'" , "'" ) ;
10- }
2+ import { escapeHtml } from "../src/shared/string/stringUtil.js" ;
113
124function renderToolCard ( tool ) {
135 const sampleLinks = Array . isArray ( tool . sampleEntryPoints ) && tool . sampleEntryPoints . length > 0
Original file line number Diff line number Diff line change @@ -5,18 +5,10 @@ import {
55 readSharedPaletteHandoff
66} from "./assetUsageIntegration.js" ;
77import { createProjectSystemController } from "./projectSystem.js" ;
8+ import { escapeHtml } from "../../src/shared/string/stringUtil.js" ;
89
910let projectController = null ;
1011
11- function escapeHtml ( value ) {
12- return String ( value ?? "" )
13- . replaceAll ( "&" , "&" )
14- . replaceAll ( "<" , "<" )
15- . replaceAll ( ">" , ">" )
16- . replaceAll ( '"' , """ )
17- . replaceAll ( "'" , "'" ) ;
18- }
19-
2012function getPageMode ( ) {
2113 return document . body . dataset . toolsPlatformPage || "tool" ;
2214}
You can’t perform that action at this time.
0 commit comments