@@ -12,7 +12,7 @@ import {emptyObject} from "../object/construct.js";
1212import { descriptive } from "../object/concrete.js" ;
1313import { keying } from "../../protocols/imapentry/concrete.js" ;
1414import { hashKeyed as hash } from "../../protocols/ihashable/hashers.js" ;
15- import { reduceWith , reducekvWith } from "../../shared.js" ;
15+ import { reduceWith , reducekvWith , itopic } from "../../shared.js" ;
1616import * as p from "./protocols.js" ;
1717
1818const keys = Object . keys ;
@@ -101,28 +101,13 @@ function clone(self){
101101 return Object . assign ( { } , self ) ;
102102}
103103
104- function assert2 ( self , key ) {
105- return p . contains ( self , key ) ? [ [ key , p . get ( self , key ) ] ] : null ;
106- }
107-
108- function assert1 ( self ) {
109- return p . seq ( mapcat ( assert2 ( self , ?) , p . keys ( self ) ) ) ;
110- }
111-
112- export const assert = overload ( null , assert1 , assert2 , p . assoc ) ;
113-
114- function retract3 ( self , key , value ) {
115- return p . equiv ( p . get ( self , key ) , value ) ? p . dissoc ( self , key ) : self ;
116- }
117-
118- export const retract = overload ( null , null , p . dissoc , retract3 ) ;
119-
120104const reduce = reduceWith ( p . seq ) ;
121105const reducekv = reducekvWith ( p . seq ) ;
122106const count = comp ( p . count , p . keys ) ;
123107
124108export default does (
125109 keying ( "Object" ) ,
110+ implement ( ITopic , itopic ( p . assoc , p . dissoc ) ) ,
126111 implement ( IHashable , { hash} ) ,
127112 implement ( IMergable , { merge} ) ,
128113 implement ( ICompactible , { compact} ) ,
@@ -138,7 +123,6 @@ export default does(
138123 implement ( IFn , { invoke : lookup } ) ,
139124 implement ( ISeq , { first, rest} ) ,
140125 implement ( ILookup , { lookup} ) ,
141- implement ( ITopic , { assert, retract} ) ,
142126 implement ( IEmptyableCollection , { empty : emptyObject } ) ,
143127 implement ( IAssociative , { assoc, contains} ) ,
144128 implement ( ISeqable , { seq} ) ,
0 commit comments