nl_tokens: Gets the commitlint config converted from a cz - customizable config .
pl_tokens: function get ( pathOrCzConfig , defaultConfig ) { const config = Object . assign ( cloneDeep ( defaults ) , cloneDeep ( defaultConfig ) || { } ) ; let czConfig = pathOrCzConfig || { } ; if ( typeof pathOrCzConfig === 'string' ) { czConfig = CzConfig . get ( pathOrCzConfig ) ; } // Converts the `scopes` and `scopeOverrides` into `scope-enum` rule. const hasScopeEnum = Object . prototype . hasOwnProperty . call ( config . rules , 'scope-enum' ) ; if ( hasScopeEnum && ( typeof czConfig . scopes !== 'undefined' || typeof czConfig . scopeOverrides !== 'undefined' ) ) { config . rules [ 'scope-enum' ] [ 2 ] = Scopes . get ( czConfig ) ; } // Removes empty `scope-enum` rule. if ( hasScopeEnum && ! config . rules [ 'scope-enum' ] [ 2 ] . length ) { delete config . rules [ 'scope-enum' ] ; } // Converts the `types` into `type-enum` rule. const hasTypeEnum = Object . prototype . hasOwnProperty . call ( config . rules , 'type-enum' ) ; if ( hasTypeEnum && typeof czConfig . types !== 'undefined' ) { config . rules [ 'type-enum' ] [ 2 ] = Types . get ( czConfig ) ; } // Removes empty `type-enum` rule. if ( hasTypeEnum && ! config . rules [ 'type-enum' ] [ 2 ] . length ) { delete config . <mask> [ 'type-enum' ] ; } return config ; }