11import chalk from 'chalk-template' ;
22import { Context , Effect , flow , pipe } from 'effect' ;
3- import { isObject } from 'tightrope/guard/is-object.js' ;
4- import { isUndefined } from 'tightrope/guard/is-undefined.js' ;
53import { logIgnoredSize } from '../bin-lint-semver-ranges/lint-semver-ranges.js' ;
64import {
75 logMissingLocalVersion ,
@@ -14,7 +12,6 @@ import type { CliConfig } from '../config/types.js';
1412import { ICON } from '../constants.js' ;
1513import type { ErrorHandlers } from '../error-handlers/default-error-handlers.js' ;
1614import { defaultErrorHandlers } from '../error-handlers/default-error-handlers.js' ;
17- import type { Ctx } from '../get-context/index.js' ;
1815import { getContext } from '../get-context/index.js' ;
1916import { getInstances } from '../get-instances/index.js' ;
2017import { exitIfInvalid } from '../io/exit-if-invalid.js' ;
@@ -103,8 +100,6 @@ export function fixMismatches({
103100 index ++ ;
104101 }
105102
106- yield * $ ( removeEmptyObjects ( ctx ) ) ;
107-
108103 return ctx ;
109104 } ) ,
110105 Effect . flatMap ( writeIfChanged ) ,
@@ -137,25 +132,6 @@ export function fixMismatch(report: Report.Version.Fixable.Any) {
137132 ) ;
138133}
139134
140- /** Remove empty objects such as `{"dependencies": {}}` left after deleting */
141- function removeEmptyObjects ( ctx : Ctx ) {
142- return Effect . sync ( ( ) => {
143- ctx . packageJsonFiles . forEach ( file => {
144- const contents = file . jsonFile . contents ;
145- Object . keys ( contents ) . forEach ( key => {
146- const value = contents [ key ] ;
147- if (
148- isObject ( value ) &&
149- value &&
150- Object . values ( value ) . every ( isUndefined )
151- ) {
152- delete contents [ key ] ;
153- }
154- } ) ;
155- } ) ;
156- } ) ;
157- }
158-
159135export function logAlreadyValidSize ( amount : number ) {
160136 const msg = chalk `${ padStart ( amount ) } {green ${ ICON . tick } } already valid` ;
161137 return Effect . logInfo ( msg ) ;
0 commit comments