func parseAssumesExpr(exprDecl interface{}) (Expression, error) {
	// Is it a composite expression?
	if exprAsMap, isMap := exprDecl.(map[interface{}]interface{}); isMap {
		coercedMap := make(map[string]interface{})
		for key, val := range exprAsMap {
			keyStr, ok := key.(string)
			if !ok {
				return nil, errors.New(`malformed composite expression`)
			}
			coercedMap[keyStr] = val
		}
		return parseCompositeExpr(coercedMap)
	} else if exprAsMap, isMap := exprDecl.(bson.M); isMap {
		coercedMap := make(map[string]interface{})
		for key, val := range exprAsMap {
			coercedMap[key] = val
		}
		return parseCompositeExpr(coercedMap)
	} else if exprAsMap, isMap := exprDecl.(map[string]interface{}); isMap {
		return parseCompositeExpr(exprAsMap)
	}

	// Is it a feature request expression?
	if exprAsString, isString := exprDecl.(string); isString {
		return parseFeatureExpr(exprAsString)
	}

	return nil, errors.New(`expected a feature, "any-of" or "all-of" expression`)
}
// parseAssumesExpr returns an Expression instance that corresponds to the
// provided expression declaration. As per the assumes spec, the parser
// supports the following expression types:
//
// 1) feature request expression with optional version constraint (e.g. foo < 1)
// 2) any-of composite expression
// 3) all-of composite expression
parseAssumesExpr returns an Expression instance that corresponds to the
provided expression declaration. As per the assumes spec, the parser
supports the following expression types.

1) feature request expression with optional version constraint
2) any-of composite expression
3) all-of composite expression
// parseAssumesExpr returns an Expression instance that corresponds to the // provided expression declaration . As per the assumes spec the parser // supports the following expression types : // // 1 ) feature request expression with optional version constraint ( e . g . foo < 1 ) // 2 ) any - of composite expression // 3 ) all - of composite expression
func parseAssumesExpr(exprDecl interface{}) (Expression, error) {
	if exprAsMap, isMap := exprDecl.(map[interface{}]interface{}); isMap {
		coercedMap := make(map[string]interface{})
		for key, val := range exprAsMap {
			keyStr, ok := key.(string)
			if !ok {
				return nil, errors.New(`malformed composite expression`)
			}
			coercedMap[keyStr] = val
		}
		return parseCompositeExpr(coercedMap)
	} else if exprAsMap, isMap := exprDecl.(bson.M); isMap {
		coercedMap := make(map[string]interface{})
		for key, val := range exprAsMap {
			coercedMap[key] = val
		}
		return parseCompositeExpr(coercedMap)
	} else if exprAsMap, isMap := exprDecl.(map[string]interface{}); isMap {
		return parseCompositeExpr(exprAsMap)
	}
	if exprAsString, isString := exprDecl.(string); isString {
		return parseFeatureExpr(exprAsString)
	}
	return nil, errors.New(`expected a feature, "any-of" or "all-of" expression`)
}
func parseAssumesExpr ( exprDecl interface { } ) ( Expression , error ) { if exprAsMap , isMap := exprDecl . ( map [ interface { } ] interface { } ) ; isMap { coercedMap := make ( map [ string ] interface { } ) for key , val := range exprAsMap { keyStr , ok := key . ( string ) if ! ok { return nil , errors . New ( `malformed composite expression` ) } coercedMap [ keyStr ] = val } return parseCompositeExpr ( coercedMap ) } else if exprAsMap , isMap := exprDecl . ( bson . M ) ; isMap { coercedMap := make ( map [ string ] interface { } ) for key , val := range exprAsMap { coercedMap [ key ] = val } return parseCompositeExpr ( coercedMap ) } else if exprAsMap , isMap := exprDecl . ( map [ string ] interface { } ) ; isMap { return parseCompositeExpr ( exprAsMap ) } if exprAsString , isString := exprDecl . ( string ) ; isString { return parseFeatureExpr ( exprAsString ) } return nil , errors . New ( `expected a feature, "any-of" or "all-of" expression` ) }
parseAssumesExpr returns an Expression instance that corresponds to the
provided expression declaration.
parseAssumesExpr returns an Expression instance that corresponds to the provided expression declaration .
// Is it a composite expression? // Is it a feature request expression?