@@ -78,37 +78,3 @@ export class ResourceContextKey extends Disposable implements IContextKey<URI> {
7878 return this . _resourceKey . get ( ) ;
7979 }
8080}
81-
82- /**
83- * Data URI related helpers.
84- */
85- export namespace DataUri {
86-
87- export const META_DATA_LABEL = 'label' ;
88- export const META_DATA_DESCRIPTION = 'description' ;
89- export const META_DATA_SIZE = 'size' ;
90- export const META_DATA_MIME = 'mime' ;
91-
92- export function parseMetaData ( dataUri : URI ) : Map < string , string > {
93- const metadata = new Map < string , string > ( ) ;
94-
95- // Given a URI of: data:image/png;size:2313;label:SomeLabel;description:SomeDescription;base64,77+9UE5...
96- // the metadata is: size:2313;label:SomeLabel;description:SomeDescription
97- const meta = dataUri . path . substring ( dataUri . path . indexOf ( ';' ) + 1 , dataUri . path . lastIndexOf ( ';' ) ) ;
98- meta . split ( ';' ) . forEach ( property => {
99- const [ key , value ] = property . split ( ':' ) ;
100- if ( key && value ) {
101- metadata . set ( key , value ) ;
102- }
103- } ) ;
104-
105- // Given a URI of: data:image/png;size:2313;label:SomeLabel;description:SomeDescription;base64,77+9UE5...
106- // the mime is: image/png
107- const mime = dataUri . path . substring ( 0 , dataUri . path . indexOf ( ';' ) ) ;
108- if ( mime ) {
109- metadata . set ( META_DATA_MIME , mime ) ;
110- }
111-
112- return metadata ;
113- }
114- }
0 commit comments