mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
refactor(core): zero circulars + esm ready (#10770)
This commit is contained in:
@ -27,7 +27,7 @@ const minWidthHeightQualifier: QualifierSpec = {
|
||||
return path.match(new RegExp(`.${MIN_WH}\\d+`, 'g'));
|
||||
},
|
||||
getMatchValue(value: string, context: PlatformContext): number {
|
||||
const numVal = parseInt(value.substr(MIN_WH.length + 1));
|
||||
const numVal = parseInt(value.substring(MIN_WH.length + 1));
|
||||
if (isNaN(numVal)) {
|
||||
return -1;
|
||||
}
|
||||
@ -49,7 +49,7 @@ const minWidthQualifier: QualifierSpec = {
|
||||
return path.match(new RegExp(`.${MIN_W}\\d+`, 'g'));
|
||||
},
|
||||
getMatchValue(value: string, context: PlatformContext): number {
|
||||
const numVal = parseInt(value.substr(MIN_W.length + 1));
|
||||
const numVal = parseInt(value.substring(MIN_W.length + 1));
|
||||
if (isNaN(numVal)) {
|
||||
return -1;
|
||||
}
|
||||
@ -71,7 +71,7 @@ const minHeightQualifier: QualifierSpec = {
|
||||
return path.match(new RegExp(`.${MIN_H}\\d+`, 'g'));
|
||||
},
|
||||
getMatchValue(value: string, context: PlatformContext): number {
|
||||
const numVal = parseInt(value.substr(MIN_H.length + 1));
|
||||
const numVal = parseInt(value.substring(MIN_H.length + 1));
|
||||
if (isNaN(numVal)) {
|
||||
return -1;
|
||||
}
|
||||
@ -93,7 +93,7 @@ const platformQualifier: QualifierSpec = {
|
||||
return path.match(new RegExp('\\.android|\\.ios', 'g'));
|
||||
},
|
||||
getMatchValue(value: string, context: PlatformContext): number {
|
||||
const val = value.substr(1);
|
||||
const val = value.substring(1);
|
||||
|
||||
return val === context.os.toLowerCase() ? 1 : -1;
|
||||
},
|
||||
@ -107,7 +107,7 @@ const orientationQualifier: QualifierSpec = {
|
||||
return path.match(new RegExp('\\.land|\\.port', 'g'));
|
||||
},
|
||||
getMatchValue(value: string, context: PlatformContext): number {
|
||||
const val = value.substr(1);
|
||||
const val = value.substring(1);
|
||||
const isLandscape: number = context.width > context.height ? 1 : -1;
|
||||
|
||||
return val === 'land' ? isLandscape : -isLandscape;
|
||||
|
||||
Reference in New Issue
Block a user