nl_tokens: / * function makeChangeConverter ( type ) { _ . errout ( TODO REMOVE ) if ( type . type === set || type . type === list ) { return function ( state ) { var changes = [] _ . assertDefined ( state ) _ . assertArray ( state )
pl_tokens: function makeStateValidator ( type ) { if ( type . type === 'set' || type . type === 'list' ) { return function ( s ) { _ . assertArray ( s ) return s } } else if ( type . type === 'map' ) { return function ( m ) { if ( m === undefined ) return { } _ . assertObject ( m ) return m } } else if ( type . type === 'primitive' ) { return function ( v ) { _ . assertPrimitive ( v ) return v } } else if ( type . type === 'object' ) { return function ( id ) { _ . assertNot ( _ . isArray ( id ) ) return id } } else if ( type . type === 'view' ) { return function ( id ) { _ . assertNot ( _ . isArray ( <mask> ) ) if ( id !== undefined ) _ . assertString ( id ) return id } } else if ( type . type === 'nil' ) { return function ( n ) { return n } } else { _ . errout ( 'TODO: ' + JSON . stringify ( type ) ) } }