Some Random Cat
PackageGitHubDocumentationSupport
Insiders
Insiders
  • Introduction
  • Examples
    • Random Cat Image
    • Random Joke
  • Documentation
    • Classes
      • Generation
      • Random
      • Util
  • Misc
    • Reading Notation
Powered by GitBook
On this page
  • Methods </ >
  • .formatTime(time) STATIC </ >
  • .generateId(options) STATIC </ >
  • .getAcronym(name) STATIC </ >
  • .shorten(text, length) STATIC </ >

Was this helpful?

Export as PDF
  1. Documentation
  2. Classes

Generation

The class for generating secure IDs, formatting time and much more...

PreviousClassesNextRandom

Last updated 4 years ago

Was this helpful?

Please make sure you do not instantiate this class. You can access it throughconst somethingRandom = require('some-random-cat').Generation

Methods

.formatTime(time) STATIC

Generation method to format time to 00:00

PARAMETER

TYPE

OPTIONAL

DEFAULT

DESCRIPTION

time

❌

none

The time to format.

Returns: <>

.generateId(options) STATIC

Generation method to secure a well secure UUID.

PARAMETER

TYPE

OPTIONAL

DEFAULT

DESCRIPTION

options

✅

none

The options for the ID.

options.putDash

✅

true

Whether or not to put a -

Returns: <>

.getAcronym(name) STATIC

Generation method to get acronym for a string.

PARAMETER

TYPE

OPTIONAL

DEFAULT

DESCRIPTION

name

String

❌

none

The string to get acronym for.

Generation method to shorten a string by length.

PARAMETER

TYPE

OPTIONAL

DEFAULT

DESCRIPTION

text

String

❌

none

The string to shorten.

length

Number

❌

none

The length to shorten.

Returns: <>

.shorten(text, length) STATIC

Returns: <>

</ >
</ >
Promise
String
</ >
Promise
String
</ >
Promise
String
</ >
Promise
String
Number
Object
Boolean