@@ -11,10 +11,8 @@ const STRING_EMPTY = "";
1111const STRING_PIPE = "|" ;
1212const STRING_DOUBLE_PIPE = "||" ;
1313const STRING_DOUBLE_AND = "&&" ;
14-
15- // String constants - Operation and type names
16- const STRING_ID = "id" ;
1714const STRING_FUNCTION = "function" ;
15+ const STRING_ID = "id" ;
1816const STRING_INDEXES = "indexes" ;
1917const STRING_OBJECT = "object" ;
2018const STRING_RECORDS = "records" ;
@@ -61,7 +59,17 @@ const STRING_ERROR_SET_KEY_TYPE = "set: key must be a string or number";
6159const STRING_ERROR_SET_DATA_TYPE = "set: data must be an object" ;
6260const STRING_ERROR_SORT_FN_TYPE = "sort: fn must be a function" ;
6361const STRING_ERROR_WHERE_OP_TYPE = "where: op must be a string" ;
64- const STRING_ERROR_WHERE_PREDICATE_TYPE = "where: predicate must be an object" ; /**
62+ const STRING_ERROR_WHERE_PREDICATE_TYPE = "where: predicate must be an object" ;
63+
64+ // String constants - Property names
65+ const PROP_DELIMITER = "delimiter" ;
66+ const PROP_ID = "id" ;
67+ const PROP_IMMUTABLE = "immutable" ;
68+ const PROP_INDEX = "index" ;
69+ const PROP_KEY = "key" ;
70+ const PROP_VERSIONING = "versioning" ;
71+ const PROP_VERSIONS = "versions" ;
72+ const PROP_WARN_ON_FULL_SCAN = "warnOnFullScan" ; /**
6573 * Haro is an immutable DataStore with indexing, versioning, and batch operations.
6674 * Provides a Map-like interface with advanced querying capabilities.
6775 * @class
@@ -131,35 +139,35 @@ class Haro {
131139 enumerable : true ,
132140 get : ( ) => this . #data. size ,
133141 } ) ;
134- Object . defineProperty ( this , "key" , {
142+ Object . defineProperty ( this , PROP_KEY , {
135143 enumerable : true ,
136144 get : ( ) => this . #key,
137145 } ) ;
138- Object . defineProperty ( this , "index" , {
146+ Object . defineProperty ( this , PROP_INDEX , {
139147 enumerable : true ,
140148 get : ( ) => [ ...this . #index] ,
141149 } ) ;
142- Object . defineProperty ( this , "delimiter" , {
150+ Object . defineProperty ( this , PROP_DELIMITER , {
143151 enumerable : true ,
144152 get : ( ) => this . #delimiter,
145153 } ) ;
146- Object . defineProperty ( this , "immutable" , {
154+ Object . defineProperty ( this , PROP_IMMUTABLE , {
147155 enumerable : true ,
148156 get : ( ) => this . #immutable,
149157 } ) ;
150- Object . defineProperty ( this , "versioning" , {
158+ Object . defineProperty ( this , PROP_VERSIONING , {
151159 enumerable : true ,
152160 get : ( ) => this . #versioning,
153161 } ) ;
154- Object . defineProperty ( this , "warnOnFullScan" , {
162+ Object . defineProperty ( this , PROP_WARN_ON_FULL_SCAN , {
155163 enumerable : true ,
156164 get : ( ) => this . #warnOnFullScan,
157165 } ) ;
158- Object . defineProperty ( this , "versions" , {
166+ Object . defineProperty ( this , PROP_VERSIONS , {
159167 enumerable : true ,
160168 get : ( ) => this . #versions,
161169 } ) ;
162- Object . defineProperty ( this , "id" , {
170+ Object . defineProperty ( this , PROP_ID , {
163171 enumerable : true ,
164172 get : ( ) => this . #id,
165173 } ) ;
0 commit comments