This brakes the sourceData functionality since the _layer variable is initialised during Line 124. It is either the supplied layer or if the layer is null, the layer is a new empty layer. Now the changed if in the _fillRecordsCache function is always true, since the _layer variable is always an object.
I have noticed that the sourceData option is not working. You can see that the example custom source data is broken.
The reason is that in the function _fillRecordsCache the if clause has been changed to "if(this._layer)" during this commit: https://github.com/stefanocudini/leaflet-search/commit/9875037eda0986c110519fe820b8f10ca6e82c81
This brakes the sourceData functionality since the _layer variable is initialised during Line 124. It is either the supplied layer or if the layer is null, the layer is a new empty layer. Now the changed if in the _fillRecordsCache function is always true, since the _layer variable is always an object.