@@ -346,15 +346,6 @@ const rpcMethodsOrEmptyArray = compose(
346346// Pick events out of the methods array
347347const eventsOrEmptyArray = compose (
348348 option ( [ ] ) ,
349- map ( filter ( validEvent ) ) ,
350- // Maintain the side effect of process.exit here if someone is violating the rules
351- map ( map ( e => {
352- if ( ! e . name . match ( / o n [ A - Z ] / ) ) {
353- console . error ( `ERROR: ${ e . name } method is tagged as an event, but does not match the pattern "on[A-Z]"` )
354- process . kill ( process . pid ) // Using process.kill so that other worspaces all exit (and don't bury this error w/ logs)
355- }
356- return e
357- } ) ) ,
358349 map ( filter ( isPublicEventMethod ) ) ,
359350 getMethods
360351)
@@ -390,15 +381,6 @@ const providedCapabilitiesOrEmptyArray = compose(
390381// Pick providers out of the methods array
391382const providersOrEmptyArray = compose (
392383 option ( [ ] ) ,
393- map ( filter ( validEvent ) ) ,
394- // Maintain the side effect of process.exit here if someone is violating the rules
395- map ( map ( e => {
396- if ( ! e . name . match ( / o n [ A - Z ] / ) ) {
397- console . error ( `ERROR: ${ e . name } method is tagged as a provider, but does not match the pattern "on[A-Z]"` )
398- process . exit ( 1 ) // Non-zero exit since we don't want to continue. Useful for CI/CD pipelines.
399- }
400- return e
401- } ) ) ,
402384 map ( filter ( isProviderInterfaceMethod ) ) ,
403385 getMethods
404386)
@@ -420,7 +402,7 @@ const getModuleName = json => {
420402 return json ? ( json . title || ( json . info ? json . info . title : 'Unknown' ) ) : 'Unknown'
421403}
422404
423- const makeEventName = x => methodName ( x ) [ 2 ] . toLowerCase ( ) + methodName ( x ) . substr ( 3 ) // onFooBar becomes fooBar
405+ const makeEventName = x => methodName ( x ) // onFooBar remains onFooBar
424406const makeProviderMethod = x => x . name [ "onRequest" . length ] . toLowerCase ( ) + x . name . substr ( "onRequest" . length + 1 ) // onRequestChallenge becomes challenge
425407
426408const generateAggregateMacros = ( platformApi , appApi , additional , templates , library ) => {
@@ -1785,7 +1767,7 @@ function insertMethodMacros(template, methodObj, platformApi, appApi, templates,
17851767 . replace ( / \$ \{ m e t h o d \. c o n t e x t \. c o u n t } / g, method . context ? method . context . length : 0 )
17861768 . replace ( / \$ \{ m e t h o d \. d e p r e c a t i o n \} / g, deprecation )
17871769 . replace ( / \$ \{ m e t h o d \. N a m e \} / g, method . name [ 0 ] . toUpperCase ( ) + method . name . substr ( 1 ) )
1788- . replace ( / \$ \{ e v e n t \. n a m e \} / g, method . name . toLowerCase ( ) [ 2 ] + method . name . substr ( 3 ) )
1770+ . replace ( / \$ \{ e v e n t \. n a m e \} / g, method . name )
17891771 . replace ( / \$ \{ e v e n t \. p a r a m s \} / g, eventParams )
17901772 . replace ( / \$ \{ e v e n t \. p a r a m s \. t a b l e \. r o w s \} / g, eventParamsRows )
17911773 . replace ( / \$ \{ i f \. e v e n t \. p a r a m s \} ( .* ?) \$ \{ e n d \. i f \. e v e n t \. p a r a m s \} / gms, event && event . params . length ? '$1' : '' )
0 commit comments