code: function wrappedGuidFn(context) {
      return function (callback) {
        // Skip the duplicate ID check if asked to
        if (flags.includes(FS_NODUPEIDCHECK)) {
          callback(null, guid());
          return;
        }
  
        // Otherwise (default) make sure this id is unused first
        function guidWithCheck(callback) {
          const id = guid();
          context.getObject(id, function (err, value) {
            if (err) {
              callback(err);
              return;
            }
  
            // If this id is unused, use it, otherwise find another
            if (!value) {
              callback(null, id);
            } else {
              guidWithCheck(callback);
            }
          });
        }
        guidWithCheck(callback);
      };
    }
docs: Deal with various approaches to node ID creation