File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -62,4 +62,14 @@ export function isFileOrResourcePath(path: string): boolean {
6262 return path . indexOf ( "~/" ) === 0 || // relative to AppRoot
6363 path . indexOf ( "/" ) === 0 || // absolute path
6464 path . indexOf ( RESOURCE_PREFIX ) === 0 ; // resource
65+ }
66+
67+ export function isDataURI ( uri : string ) : boolean {
68+ if ( ! types . isString ( uri ) ) {
69+ return false ;
70+ }
71+
72+ var firstSegment = uri . trim ( ) . split ( ',' ) [ 0 ] ;
73+
74+ return firstSegment && firstSegment . indexOf ( "data:" ) === 0 && firstSegment . indexOf ( 'base64' ) >= 0 ;
6575}
Original file line number Diff line number Diff line change 140140 * @param path The path.
141141 */
142142 export function isFileOrResourcePath ( path : string ) : boolean
143+
144+ /**
145+ * Returns true if the specified URI is data URI (http://en.wikipedia.org/wiki/Data_URI_scheme).
146+ * @param uri The URI.
147+ */
148+ export function isDataURI ( uri : string ) : boolean
143149}
You can’t perform that action at this time.
0 commit comments