# betterdocs/4.9.5/react-src/gutenberg/util/helpers/miniHelperFuncs.js

BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ &amp; Chatbot, version 4.9.5. 32 lines.

- Page: https://pluginprobe.com/plugins/betterdocs/4.9.5/code/react-src/gutenberg/util/helpers/miniHelperFuncs.js
- Raw: https://pluginprobe.com/plugins/betterdocs/4.9.5/raw/react-src/gutenberg/util/helpers/miniHelperFuncs.js
- Modified: 2026-10-12T10:07:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/betterdocs/4.9.5/code/react-src/gutenberg/util/helpers/miniHelperFuncs.js#L10-L20`.

```javascript
// helper Functions: function 'textInsideForEdit' is for setting the innertext depending on whether separator should be shown and which separator should be shown in the number-counter block
export const textInsideForEdit = (value, isShowSeparator, separator) =>
  isShowSeparator
    ? value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, separator)
    : value.toString();

// generateRandomNumber function is for generating a random number
export const generateRandomNumber = () =>
  Math.floor(Math.random() * 1000000000);

// hardMinifyCssStrings is for minifying the css which is in the style tag as a string  for view.js
export const hardMinifyCssStrings = (cssString) => {
  return (
    cssString
      .replace(/\s+/g, " ")
      .replace(/(?<=\:).+(?=\;)/g, function (match) {
        return match.trim().replace(/\s+/g, "__s_p_a_c_e__");
      })
      // .replace(/\s+(?!(?:[\w\d\.\-\#]+\{))/g, "")
      .replace(/\s+(?![\w\d\.\-\#]+\{)/g, "")
      .replace(/\s+/g, " ")
      .replace(/__s_p_a_c_e__/g, " ")
  );
};

// softMinifyCssStrings is for minifying the css which is in the style tag as a string  for view.js
export const softMinifyCssStrings = (cssString = " ") => cssString .replace(/\s+/g, " ") .replace(/\.eb\-[\w\-\s\.\,\:\>\=\"\'\(\)\d\+\[\]\#\>]+\{[\s]+\}/g, "");

// check if css string is empty or not.
export const isCssExists = (cssString) =>
  /.+(?=\:(?!hover)(?!focus))/.test(cssString);

```
