File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -167,19 +167,18 @@ pub async fn update_package_json(
167167 for ( name, version, version_spec) in package_specs {
168168 match action {
169169 PackageAction :: Add => {
170- let version_to_write = if version_spec. starts_with ( "git+" )
171- || version_spec. starts_with ( "git://" )
172- {
173- // Git specs: write the resolved URL (with pinned commit)
174- version_spec. to_string ( )
175- } else {
176- match version_spec. as_str ( ) {
177- spec if spec. is_empty ( ) || spec == "*" || spec == "latest" => {
178- format ! ( "^{version}" )
170+ let version_to_write =
171+ if version_spec. starts_with ( "git+" ) || version_spec. starts_with ( "git://" ) {
172+ // Git specs: write the resolved URL (with pinned commit)
173+ version_spec. to_string ( )
174+ } else {
175+ match version_spec. as_str ( ) {
176+ spec if spec. is_empty ( ) || spec == "*" || spec == "latest" => {
177+ format ! ( "^{version}" )
178+ }
179+ spec => spec. to_string ( ) ,
179180 }
180- spec => spec. to_string ( ) ,
181- }
182- } ;
181+ } ;
183182 deps_obj. insert ( name, Value :: String ( version_to_write) ) ;
184183 }
185184 PackageAction :: Remove => {
You can’t perform that action at this time.
0 commit comments