@injex/stdlib
Advanced tools
Comparing version 3.3.3 to 3.3.4
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.yieldToMain = exports.getConstructorName = exports.isPromise = exports.isFunction = exports.toCamelCase = void 0; | ||
var _document = (function () { | ||
try { | ||
return window.document; | ||
} | ||
catch (e) { | ||
// this is not a browser context | ||
return null; | ||
} | ||
})(); | ||
function toCamelCase(str) { | ||
@@ -21,2 +30,5 @@ return str[0].toLowerCase() + str.slice(1); | ||
function yieldToMain() { | ||
if (_document === null || _document === void 0 ? void 0 : _document.hidden) { | ||
return Promise.resolve(); | ||
} | ||
return new Promise(function (resolve) { return setTimeout(resolve, 0); }); | ||
@@ -23,0 +35,0 @@ } |
{ | ||
"name": "@injex/stdlib", | ||
"version": "3.3.3", | ||
"version": "3.3.4", | ||
"description": "", | ||
@@ -50,3 +50,3 @@ "keywords": [], | ||
}, | ||
"gitHead": "4077d8c20fff22509ca074996b87987a12141c73" | ||
"gitHead": "9fb36b9aa2307628d300b8a870cb0d62517cded4" | ||
} |
@@ -0,1 +1,10 @@ | ||
const _document = (function () { | ||
try { | ||
return window.document; | ||
} catch (e) { | ||
// this is not a browser context | ||
return null; | ||
} | ||
})(); | ||
export function toCamelCase(str: string): string { | ||
@@ -18,3 +27,7 @@ return str[0].toLowerCase() + str.slice(1); | ||
export function yieldToMain(): Promise<void> { | ||
if (_document?.hidden) { | ||
return Promise.resolve(); | ||
} | ||
return new Promise((resolve) => setTimeout(resolve, 0)); | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31599
639