Repository URL to install this package:
|
Version:
0.7.0 ▾
|
// (c) Copyright 2023 Supertenant Ltd. - all rights reserved.
// See LICENSE file in project root for license terms.
"use strict";let logger;logger=require("../logger").getLogger("util/atMostOnce",newLogger=>{logger=newLogger}),module.exports=function(name,cb){let callCount=0;return function(){if(1===++callCount)return cb.apply(null,arguments);logger.debug("Function %s was called %s times. This time with the following arguments.",name,callCount,{args:Array.prototype.slice.call(arguments)})}};