Skip to content

Commit c1106e1

Browse files
authored
Merge pull request aframevr#3854 from ngokevin/cacheregex
cache asset property type regex
2 parents 82f0961 + fbeb457 commit c1106e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/core/propertyTypes.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var warn = debug('core:propertyTypes:warn');
66

77
var propertyTypes = module.exports.propertyTypes = {};
88
var nonCharRegex = /[,> .[\]:]/;
9+
var urlRegex = /\url\((.+)\)/;
910

1011
// Built-in property types.
1112
registerPropertyType('audio', '', assetParse);
@@ -77,7 +78,7 @@ function assetParse (value) {
7778
if (typeof value !== 'string') { return value; }
7879

7980
// Wrapped `url()` in case of data URI.
80-
parsedUrl = value.match(/\url\((.+)\)/);
81+
parsedUrl = value.match(urlRegex);
8182
if (parsedUrl) { return parsedUrl[1]; }
8283

8384
// ID.

0 commit comments

Comments
 (0)