File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/app/src/sandbox/eval/presets/create-react-app Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,15 @@ import semver from 'semver';
22import { getAbsoluteDependencies } from '@codesandbox/common/lib/utils/dependencies' ;
33import Manager from 'sandbox/eval/manager' ;
44
5+ function isMinimalSemverVersion ( version : string , minimalVersion : string ) {
6+ try {
7+ return semver . gte ( version , minimalVersion ) ;
8+ } catch ( e ) {
9+ // Semver couldn't be parsed, we assume that we're on the bleeding edge now, so true.
10+ return true ;
11+ }
12+ }
13+
514export async function isMinimalReactVersion (
615 version : string ,
716 minimalVersion : string
@@ -13,7 +22,7 @@ export async function isMinimalReactVersion(
1322
1423 return (
1524 absoluteDependencies [ 'react-dom' ] . startsWith ( '0.0.0' ) ||
16- semver . gte ( absoluteDependencies [ 'react-dom' ] , minimalVersion )
25+ isMinimalSemverVersion ( absoluteDependencies [ 'react-dom' ] , minimalVersion )
1726 ) ;
1827 }
1928
You can’t perform that action at this time.
0 commit comments