Use default import if other not found

This commit is contained in:
RMidhunSuresh 2022-08-01 13:30:17 +05:30
parent ef9f90bc36
commit ba8cdea6b4
2 changed files with 2 additions and 2 deletions

View file

@ -99,7 +99,7 @@ export class DerivedVariables {
}
import * as pkg from "off-color";
const {offColor} = pkg;
const offColor = pkg.offColor ?? pkg.default.offColor;
export function tests() {
return {

View file

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import * as pkg from 'off-color';
const offColor = pkg.offColor;
const offColor = pkg.offColor ?? pkg.default.offColor;
export function derive(value, operation, argument, isDark) {
const argumentAsNumber = parseInt(argument);