aotrautils-srv 0.0.206 → 0.0.207

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- /*utils COMMONS library associated with aotra version : «1.0.0.000 (19/07/2022-02:52:00)»*/
3
+ /*utils COMMONS library associated with aotra version : «1.0.0.000 (19/07/2022-03:02:07)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4828,7 +4828,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4828
4828
 
4829
4829
 
4830
4830
 
4831
- /*utils SERVER library associated with aotra version : «1.0.0.000 (19/07/2022-02:52:00)»*/
4831
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (19/07/2022-03:02:07)»*/
4832
4832
  /*-----------------------------------------------------------------------------*/
4833
4833
 
4834
4834
 
@@ -6194,7 +6194,7 @@ class ListManager{
6194
6194
  return result;
6195
6195
  }
6196
6196
 
6197
- removeItem(id){
6197
+ removeItemById(id){
6198
6198
  if(id==null){
6199
6199
  // TRACE
6200
6200
  lognow("ERROR : Cannot remove item, no id specified.");
@@ -6207,6 +6207,30 @@ class ListManager{
6207
6207
  }
6208
6208
  delete this.itemsInfos[id];
6209
6209
  }
6210
+
6211
+ removeItem(item){
6212
+ if(item==null){
6213
+ // TRACE
6214
+ lognow("ERROR : Cannot remove item, none specified.");
6215
+ return;
6216
+ }
6217
+
6218
+ let id=null;
6219
+ foreach(this.itemsInfos,(itemInfos,key)=>{
6220
+ if(itemInfos.item===item){
6221
+ id=key;
6222
+ return "break";
6223
+ }
6224
+ });
6225
+
6226
+ if(!id){
6227
+ // TRACE
6228
+ lognow("ERROR : Cannot remove item, item not found for id «"+id+"».");
6229
+ return;
6230
+ }
6231
+
6232
+ this.removeItemById(id);
6233
+ }
6210
6234
 
6211
6235
  // Goes from 1 to <length>:
6212
6236
  getItemPosition(id){
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.206",
3
+ "version": "0.0.207",
4
4
  "main": "aotrautils-srv.build.js",
5
5
  "description": "A library for vanilla javascript utils (server-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",