Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
frank-weindel committed Jul 5, 2024
2 parents 953eee6 + 1009ee6 commit ae5215f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lightningjs/renderer",
"version": "0.9.3",
"version": "0.9.4",
"description": "Lightning 3 Renderer",
"type": "module",
"main": "./dist/exports/index.js",
Expand Down
6 changes: 4 additions & 2 deletions src/core/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

export const PROTOCOL_REGEX = /^(data|ftps?|https?):/;

export type RGBA = [r: number, g: number, b: number, a: number];
export const getNormalizedRgbaComponents = (rgba: number): RGBA => {
const r = rgba >>> 24;
Expand Down Expand Up @@ -250,8 +252,8 @@ export function isRectPositive(rect: Rect): boolean {
}

export function convertUrlToAbsolute(url: string): string {
// handle local file imports
if (self.location.protocol === 'file:') {
// handle local file imports if the url isn't remote resource or data blob
if (self.location.protocol === 'file:' && !PROTOCOL_REGEX.test(url)) {
const path = self.location.pathname.split('/');
path.pop();
const basePath = path.join('/');
Expand Down

0 comments on commit ae5215f

Please sign in to comment.