@@ -397,12 +397,12 @@ function findInOutOverlap(outputs, inputs, head, dispatchError) {
397
397
}
398
398
399
399
function findMismatchedWildcards ( outputs , inputs , state , head , dispatchError ) {
400
- const { anyKeys : out0AnyKeys } = findWildcardKeys ( outputs [ 0 ] . id ) ;
401
- outputs . forEach ( ( out , outi ) => {
402
- if ( outi && ! equals ( findWildcardKeys ( out . id ) . anyKeys , out0AnyKeys ) ) {
400
+ const { matchKeys : out0MatchKeys } = findWildcardKeys ( outputs [ 0 ] . id ) ;
401
+ outputs . forEach ( ( out , i ) => {
402
+ if ( i && ! equals ( findWildcardKeys ( out . id ) . matchKeys , out0MatchKeys ) ) {
403
403
dispatchError ( 'Mismatched `MATCH` wildcards across `Output`s' , [
404
404
head ,
405
- `Output ${ outi } (${ combineIdAndProp ( out ) } )` ,
405
+ `Output ${ i } (${ combineIdAndProp ( out ) } )` ,
406
406
'does not have MATCH wildcards on the same keys as' ,
407
407
`Output 0 (${ combineIdAndProp ( outputs [ 0 ] ) } ).` ,
408
408
'MATCH wildcards must be on the same keys for all Outputs.' ,
@@ -415,9 +415,9 @@ function findMismatchedWildcards(outputs, inputs, state, head, dispatchError) {
415
415
[ state , 'State' ] ,
416
416
] . forEach ( ( [ args , cls ] ) => {
417
417
args . forEach ( ( arg , i ) => {
418
- const { anyKeys , allsmallerKeys} = findWildcardKeys ( arg . id ) ;
419
- const allWildcardKeys = anyKeys . concat ( allsmallerKeys ) ;
420
- const diff = difference ( allWildcardKeys , out0AnyKeys ) ;
418
+ const { matchKeys , allsmallerKeys} = findWildcardKeys ( arg . id ) ;
419
+ const allWildcardKeys = matchKeys . concat ( allsmallerKeys ) ;
420
+ const diff = difference ( allWildcardKeys , out0MatchKeys ) ;
421
421
if ( diff . length ) {
422
422
diff . sort ( ) ;
423
423
dispatchError ( '`Input` / `State` wildcards not in `Output`s' , [
@@ -640,7 +640,7 @@ export function computeGraphs(dependencies, dispatchError) {
640
640
* {[id]: {[prop]: [callback, ...]}}
641
641
* where callbacks are the matching specs from the original
642
642
* dependenciesRequest, but with outputs parsed to look like inputs,
643
- * and a list anyKeys added if the outputs have MATCH wildcards.
643
+ * and a list matchKeys added if the outputs have MATCH wildcards.
644
644
* For outputMap there should only ever be one callback per id/prop
645
645
* but for inputMap there may be many.
646
646
*
@@ -786,10 +786,10 @@ export function computeGraphs(dependencies, dispatchError) {
786
786
// Also collect MATCH keys in the output (all outputs must share these)
787
787
// and ALL keys in the first output (need not be shared but we'll use
788
788
// the first output for calculations) for later convenience.
789
- const { anyKeys } = findWildcardKeys ( outputs [ 0 ] . id ) ;
789
+ const { matchKeys } = findWildcardKeys ( outputs [ 0 ] . id ) ;
790
790
const firstSingleOutput = findIndex ( o => ! isMultiValued ( o . id ) , outputs ) ;
791
791
const finalDependency = mergeRight (
792
- { anyKeys , firstSingleOutput, outputs} ,
792
+ { matchKeys , firstSingleOutput, outputs} ,
793
793
dependency
794
794
) ;
795
795
@@ -822,20 +822,20 @@ export function computeGraphs(dependencies, dispatchError) {
822
822
}
823
823
824
824
function findWildcardKeys ( id ) {
825
- const anyKeys = [ ] ;
825
+ const matchKeys = [ ] ;
826
826
const allsmallerKeys = [ ] ;
827
827
if ( typeof id === 'object' ) {
828
828
forEachObjIndexed ( ( val , key ) => {
829
829
if ( val === MATCH ) {
830
- anyKeys . push ( key ) ;
830
+ matchKeys . push ( key ) ;
831
831
} else if ( val === ALLSMALLER ) {
832
832
allsmallerKeys . push ( key ) ;
833
833
}
834
834
} , id ) ;
835
- anyKeys . sort ( ) ;
835
+ matchKeys . sort ( ) ;
836
836
allsmallerKeys . sort ( ) ;
837
837
}
838
- return { anyKeys , allsmallerKeys} ;
838
+ return { matchKeys , allsmallerKeys} ;
839
839
}
840
840
841
841
/*
@@ -1064,8 +1064,8 @@ function addResolvedFromOutputs(callback, outPattern, outs, matches) {
1064
1064
1065
1065
function addAllResolvedFromOutputs ( resolve , paths , matches ) {
1066
1066
return callback => {
1067
- const { anyKeys , firstSingleOutput, outputs} = callback ;
1068
- if ( anyKeys . length ) {
1067
+ const { matchKeys , firstSingleOutput, outputs} = callback ;
1068
+ if ( matchKeys . length ) {
1069
1069
const singleOutPattern = outputs [ firstSingleOutput ] ;
1070
1070
if ( singleOutPattern ) {
1071
1071
addResolvedFromOutputs (
@@ -1083,9 +1083,9 @@ function addAllResolvedFromOutputs(resolve, paths, matches) {
1083
1083
const anySeen = { } ;
1084
1084
outputs . forEach ( outPattern => {
1085
1085
const outSet = resolve ( paths ) ( outPattern ) . filter ( i => {
1086
- const matchKeys = JSON . stringify ( props ( anyKeys , i . id ) ) ;
1087
- if ( ! anySeen [ matchKeys ] ) {
1088
- anySeen [ matchKeys ] = 1 ;
1086
+ const matchStr = JSON . stringify ( props ( matchKeys , i . id ) ) ;
1087
+ if ( ! anySeen [ matchStr ] ) {
1088
+ anySeen [ matchStr ] = 1 ;
1089
1089
return true ;
1090
1090
}
1091
1091
return false ;
0 commit comments