@@ -83,8 +83,6 @@ class SpecMap {
8383 // We might consider making this (traversing & application) configurable later.
8484 function createKeyBasedPlugin ( pluginObj ) {
8585 return function * ( patches , specmap ) {
86- const resultCache = { }
87-
8886 for ( const patch of patches . filter ( lib . isAdditiveMutation ) ) {
8987 yield * traverse ( patch . value , patch . path , patch )
9088 }
@@ -104,29 +102,13 @@ class SpecMap {
104102 for ( const key of Object . keys ( obj ) ) {
105103 const val = obj [ key ]
106104 const updatedPath = path . concat ( key )
107- const isObj = lib . isObject ( val )
108-
109- // If the object has a meta '$$ref' - and store this $$ref
110- // in a lookaside to prevent future traversals of this $ref's tree.
111- const objRef = obj . $$ref
112105
113- if ( isObj ) {
114- // console.log('recursive case', {obj, path, patch})
106+ if ( lib . isObject ( val ) ) {
115107 yield * traverse ( val , updatedPath , patch )
116108 }
117109
118110 if ( ! isRootProperties && key === pluginObj . key ) {
119- // console.log('base case', {obj, path, patch})
120- const stringifiedPath = path . join ( '/' )
121-
122- if ( resultCache [ stringifiedPath ] ) {
123- yield resultCache [ stringifiedPath ]
124- }
125- else {
126- const res = pluginObj . plugin ( val , key , updatedPath , specmap , patch )
127- resultCache [ stringifiedPath ] = res
128- yield res
129- }
111+ yield pluginObj . plugin ( val , key , updatedPath , specmap , patch )
130112 }
131113 }
132114 }
0 commit comments