INNER CODE UNIT · JavaScript

s4

lucasferreira/react-native-flash-message · src/FlashMessage.js:38

  function s4() {
    return Math.floor((1 + Math.random()) * 0x10000)
      .toString(16)
      .substring(1);
  }

  return `${s4()}-${s4()}-${s4()}`;
}

/**
 * Translates icon prop value into complex internal object
 */
function parseIcon(icon = "none") {
  if (!!icon && icon !== "none") {
    if (typeof icon === "string" || typeof icon === "function") {
      return { icon, position: "left", style: {} };
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…