@@ -16,9 +16,7 @@ async function openapiOverlay(oaObj, options) {
1616 let usedActions = [ ] ; // Initialize usedActions array
1717
1818 if ( ! isSupportedOverlayVersion ( overlayVersion ) ) {
19- console . error (
20- `Unsupported overlay version "${ overlayVersion } ". Supported versions are 1.0.x and 1.1.x.`
21- ) ;
19+ console . error ( `Unsupported overlay version "${ overlayVersion } ". Supported versions are 1.0.x and 1.1.x.` ) ;
2220 return {
2321 data : oaObj ,
2422 resultData : {
@@ -172,9 +170,7 @@ function applyUpdateAction({root, target, update, actionLabel}) {
172170 if ( isPlainObject ( root ) && isPlainObject ( update ) ) {
173171 return { root : deepMerge ( root , cloneJsonLike ( update ) ) , used : true } ;
174172 }
175- console . error (
176- `${ actionLabel } : update at target "$" requires both root and update to be JSON objects.`
177- ) ;
173+ console . error ( `${ actionLabel } : update at target "$" requires both root and update to be JSON objects.` ) ;
178174 return { root, used : false } ;
179175 }
180176
@@ -208,9 +204,7 @@ function applyUpdateAction({root, target, update, actionLabel}) {
208204function applyCopyAction ( { root, target, from, actionLabel} ) {
209205 const fromNodes = resolveJsonPath ( root , from ) ;
210206 if ( fromNodes . length !== 1 ) {
211- console . error (
212- `${ actionLabel } : "from" must resolve to exactly one node, resolved ${ fromNodes . length } .`
213- ) ;
207+ console . error ( `${ actionLabel } : "from" must resolve to exactly one node, resolved ${ fromNodes . length } .` ) ;
214208 return { root, used : false } ;
215209 }
216210
@@ -220,9 +214,7 @@ function applyCopyAction({root, target, from, actionLabel}) {
220214 if ( isPlainObject ( root ) && isPlainObject ( sourceValue ) ) {
221215 return { root : deepMerge ( root , cloneJsonLike ( sourceValue ) ) , used : true } ;
222216 }
223- console . error (
224- `${ actionLabel } : copy at target "$" requires both root and source to be JSON objects.`
225- ) ;
217+ console . error ( `${ actionLabel } : copy at target "$" requires both root and source to be JSON objects.` ) ;
226218 return { root, used : false } ;
227219 }
228220
@@ -264,9 +256,7 @@ function applyValueByTargetType({targetValue, incomingValue, mode, actionLabel})
264256
265257 if ( isPlainObject ( targetValue ) ) {
266258 if ( ! isPlainObject ( incomingValue ) ) {
267- console . error (
268- `${ actionLabel } : ${ mode } type mismatch - object target requires object value.`
269- ) ;
259+ console . error ( `${ actionLabel } : ${ mode } type mismatch - object target requires object value.` ) ;
270260 return { ok : false , value : targetValue } ;
271261 }
272262
@@ -277,9 +267,7 @@ function applyValueByTargetType({targetValue, incomingValue, mode, actionLabel})
277267 }
278268
279269 if ( ! isPrimitiveLike ( incomingValue ) ) {
280- console . error (
281- `${ actionLabel } : ${ mode } type mismatch - primitive target requires primitive value.`
282- ) ;
270+ console . error ( `${ actionLabel } : ${ mode } type mismatch - primitive target requires primitive value.` ) ;
283271 return { ok : false , value : targetValue } ;
284272 }
285273
@@ -294,12 +282,7 @@ function isPlainObject(value) {
294282}
295283
296284function isPrimitiveLike ( value ) {
297- return (
298- value === null ||
299- typeof value === 'string' ||
300- typeof value === 'number' ||
301- typeof value === 'boolean'
302- ) ;
285+ return value === null || typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' ;
303286}
304287
305288/**
0 commit comments