tiny-essentials 1.16.1 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/legacy/crypto/decrypt.cjs +1 -0
- package/dist/legacy/crypto/decrypt.d.mts +1 -0
- package/dist/legacy/crypto/decrypt.mjs +1 -0
- package/dist/legacy/crypto/encrypt.cjs +1 -0
- package/dist/legacy/crypto/encrypt.d.mts +1 -0
- package/dist/legacy/crypto/encrypt.mjs +1 -0
- package/dist/legacy/get/decimalColor.cjs +1 -0
- package/dist/legacy/get/decimalColor.d.mts +1 -0
- package/dist/legacy/get/decimalColor.mjs +1 -0
- package/dist/legacy/get/pagination.cjs +1 -0
- package/dist/legacy/get/pagination.d.mts +1 -0
- package/dist/legacy/get/pagination.mjs +1 -0
- package/dist/legacy/get/queryUrlByName.cjs +1 -0
- package/dist/legacy/get/queryUrlByName.d.mts +1 -0
- package/dist/legacy/get/queryUrlByName.mjs +1 -0
- package/dist/legacy/get/queryUrlJSON.cjs +1 -0
- package/dist/legacy/get/queryUrlJSON.d.mts +1 -0
- package/dist/legacy/get/queryUrlJSON.mjs +1 -0
- package/dist/legacy/get/super_string_filter.cjs +1 -0
- package/dist/legacy/get/super_string_filter.d.mts +1 -0
- package/dist/legacy/get/super_string_filter.mjs +1 -0
- package/dist/legacy/get/versionCheck.cjs +1 -0
- package/dist/legacy/get/versionCheck.d.mts +1 -0
- package/dist/legacy/get/versionCheck.mjs +1 -0
- package/dist/legacy/http/HTTP-1.0.cjs +2 -0
- package/dist/legacy/http/HTTP-1.0.mjs +2 -0
- package/dist/legacy/http/auth.cjs +1 -0
- package/dist/legacy/http/auth.d.mts +1 -0
- package/dist/legacy/http/auth.mjs +1 -0
- package/dist/legacy/http/check_domain.cjs +11 -0
- package/dist/legacy/http/check_domain.d.mts +3 -0
- package/dist/legacy/http/check_domain.mjs +11 -0
- package/dist/legacy/http/csrfTokenAnalyze.cjs +1 -0
- package/dist/legacy/http/csrfTokenAnalyze.d.mts +1 -0
- package/dist/legacy/http/csrfTokenAnalyze.mjs +1 -0
- package/dist/legacy/http/domainValidator.cjs +1 -0
- package/dist/legacy/http/domainValidator.d.mts +1 -0
- package/dist/legacy/http/domainValidator.mjs +1 -0
- package/dist/legacy/http/errorsCallback.cjs +1 -0
- package/dist/legacy/http/errorsCallback.d.mts +1 -0
- package/dist/legacy/http/errorsCallback.mjs +1 -0
- package/dist/legacy/http/fetch/json.cjs +1 -0
- package/dist/legacy/http/fetch/json.d.mts +1 -0
- package/dist/legacy/http/fetch/json.mjs +1 -0
- package/dist/legacy/http/fetch/text.cjs +1 -0
- package/dist/legacy/http/fetch/text.d.mts +1 -0
- package/dist/legacy/http/fetch/text.mjs +1 -0
- package/dist/legacy/http/fileCache.cjs +1 -0
- package/dist/legacy/http/fileCache.d.mts +1 -0
- package/dist/legacy/http/fileCache.mjs +1 -0
- package/dist/legacy/http/getDomainURL.cjs +1 -0
- package/dist/legacy/http/getDomainURL.d.mts +1 -0
- package/dist/legacy/http/getDomainURL.mjs +1 -0
- package/dist/legacy/http/userIP.cjs +1 -0
- package/dist/legacy/http/userIP.d.mts +1 -0
- package/dist/legacy/http/userIP.mjs +1 -0
- package/dist/legacy/libs/capitalize.cjs +1 -0
- package/dist/legacy/libs/capitalize.d.mts +1 -0
- package/dist/legacy/libs/capitalize.mjs +1 -0
- package/dist/legacy/libs/convertBytes.cjs +2 -0
- package/dist/legacy/libs/convertBytes.mjs +2 -0
- package/dist/legacy/libs/custom_module_loader.cjs +2 -0
- package/dist/legacy/libs/custom_module_loader.mjs +2 -0
- package/dist/legacy/libs/dice.cjs +2 -0
- package/dist/legacy/libs/dice.mjs +2 -0
- package/dist/legacy/libs/markdown.cjs +1 -0
- package/dist/legacy/libs/markdown.mjs +1 -0
- package/dist/legacy/libs/percentage.cjs +1 -0
- package/dist/legacy/libs/percentage.mjs +1 -0
- package/dist/legacy/libs/regex/getLetter.cjs +2 -0
- package/dist/legacy/libs/regex/getLetter.d.mts +2 -0
- package/dist/legacy/libs/regex/getLetter.mjs +2 -0
- package/dist/legacy/libs/rule3.cjs +1 -0
- package/dist/legacy/libs/rule3.mjs +1 -0
- package/dist/legacy/momentjs/getAge.cjs +1 -0
- package/dist/legacy/momentjs/getAge.d.mts +1 -0
- package/dist/legacy/momentjs/getAge.mjs +1 -0
- package/dist/legacy/momentjs/timeDuration.cjs +1 -0
- package/dist/legacy/momentjs/timeDuration.d.mts +1 -0
- package/dist/legacy/momentjs/timeDuration.mjs +1 -0
- package/dist/legacy/socket.io/antiFlood/install.cjs +1 -0
- package/dist/legacy/socket.io/antiFlood/install.d.mts +1 -0
- package/dist/legacy/socket.io/antiFlood/install.mjs +1 -0
- package/dist/legacy/socket.io/antiFlood/verify.cjs +1 -0
- package/dist/legacy/socket.io/antiFlood/verify.d.mts +1 -0
- package/dist/legacy/socket.io/antiFlood/verify.mjs +1 -0
- package/dist/legacy/socket.io/cookie-session.cjs +1 -0
- package/dist/legacy/socket.io/cookie-session.d.mts +1 -0
- package/dist/legacy/socket.io/cookie-session.mjs +1 -0
- package/dist/legacy/socket.io/discord.cjs +1 -0
- package/dist/legacy/socket.io/discord.d.mts +1 -0
- package/dist/legacy/socket.io/discord.mjs +1 -0
- package/dist/v1/TinyAfterScrollWatcher.js +49 -26
- package/dist/v1/TinyAfterScrollWatcher.min.js +1 -1
- package/dist/v1/TinyBasicsEs.js +559 -71
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyDragger.js +486 -47
- package/dist/v1/TinyDragger.min.js +1 -1
- package/dist/v1/TinyEssentials.js +2545 -98
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyHtml.js +486 -47
- package/dist/v1/TinyHtml.min.js +1 -1
- package/dist/v1/TinySmartScroller.js +6230 -0
- package/dist/v1/TinySmartScroller.min.js +1 -0
- package/dist/v1/TinyUploadClicker.js +1538 -72
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/UltraRandomMsgGen.js +995 -0
- package/dist/v1/UltraRandomMsgGen.min.js +1 -0
- package/dist/v1/basics/html.cjs +74 -24
- package/dist/v1/basics/html.d.mts +38 -15
- package/dist/v1/basics/html.mjs +63 -20
- package/dist/v1/build/TinySmartScroller.cjs +7 -0
- package/dist/v1/build/TinySmartScroller.d.mts +3 -0
- package/dist/v1/build/TinySmartScroller.mjs +2 -0
- package/dist/v1/build/UltraRandomMsgGen.cjs +7 -0
- package/dist/v1/build/UltraRandomMsgGen.d.mts +3 -0
- package/dist/v1/build/UltraRandomMsgGen.mjs +2 -0
- package/dist/v1/index.cjs +4 -0
- package/dist/v1/index.d.mts +3 -1
- package/dist/v1/index.mjs +3 -1
- package/dist/v1/libs/TinyAfterScrollWatcher.cjs +49 -26
- package/dist/v1/libs/TinyAfterScrollWatcher.d.mts +17 -14
- package/dist/v1/libs/TinyAfterScrollWatcher.mjs +50 -24
- package/dist/v1/libs/TinyHtml.cjs +486 -47
- package/dist/v1/libs/TinyHtml.d.mts +352 -139
- package/dist/v1/libs/TinyHtml.mjs +431 -47
- package/dist/v1/libs/TinySmartScroller.cjs +976 -0
- package/dist/v1/libs/TinySmartScroller.d.mts +458 -0
- package/dist/v1/libs/TinySmartScroller.mjs +856 -0
- package/dist/v1/libs/UltraRandomMsgGen.cjs +956 -0
- package/dist/v1/libs/UltraRandomMsgGen.d.mts +390 -0
- package/dist/v1/libs/UltraRandomMsgGen.mjs +825 -0
- package/docs/v1/README.md +2 -0
- package/docs/v1/basics/html.md +17 -2
- package/docs/v1/libs/TinyAfterScrollWatcher.md +54 -4
- package/docs/v1/libs/TinyHtml.md +197 -8
- package/docs/v1/libs/TinySmartScroller.md +523 -0
- package/docs/v1/libs/UltraRandomMsgGen.md +289 -0
- package/package.json +1 -1
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
# 🍮 UltraRandomMsgGen - Configuration & Constructor
|
|
2
|
+
|
|
3
|
+
A powerful and playful message generator with grammar support, emoji magic ✨, and chaos knobs 🔧.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📦 `RandomMsgModes`
|
|
8
|
+
|
|
9
|
+
Defines how messages are composed:
|
|
10
|
+
|
|
11
|
+
| Mode | Description |
|
|
12
|
+
| ------------ | ------------------------------------------------------ |
|
|
13
|
+
| `'mixed'` | Mix of readable words, gibberish, symbols, and emojis. |
|
|
14
|
+
| `'readable'` | Generates only human-readable word content. |
|
|
15
|
+
| `'chaotic'` | Full chaos mode: messy, random symbols and nonsense. |
|
|
16
|
+
| `'natural'` | Structured messages based on grammar templates. |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 🎨 `EmojiPlacement`
|
|
21
|
+
|
|
22
|
+
Controls where emojis appear in the message:
|
|
23
|
+
|
|
24
|
+
| Option | Description |
|
|
25
|
+
| ---------- | --------------------------------------- |
|
|
26
|
+
| `'inline'` | Emojis can appear within lines. |
|
|
27
|
+
| `'end'` | Emojis only appear at the end of lines. |
|
|
28
|
+
| `'none'` | No emojis at all. 😢 |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 🧰 `MsgGenConfig`
|
|
33
|
+
|
|
34
|
+
Customizable config object for controlling every aspect of the generation process:
|
|
35
|
+
|
|
36
|
+
### Basic Settings
|
|
37
|
+
|
|
38
|
+
| Property | Type | Description |
|
|
39
|
+
| ------------------- | --------- | ----------------------------------------------------- |
|
|
40
|
+
| `minLength` | `number` | Minimum length of generated text (in characters). |
|
|
41
|
+
| `maxLength` | `number` | Maximum length of generated text (in characters). |
|
|
42
|
+
| `readable` | `boolean` | If true, uses more readable, word-like content. |
|
|
43
|
+
| `useEmojis` | `boolean` | Enables emoji generation. |
|
|
44
|
+
| `includeNumbers` | `boolean` | Allows numbers to appear in output. |
|
|
45
|
+
| `includeSymbols` | `boolean` | Allows symbols like `!@#$` in output. |
|
|
46
|
+
| `allowWeirdSpacing` | `boolean` | Allows extra spacing, newlines, or unexpected casing. |
|
|
47
|
+
|
|
48
|
+
### Word and Emoji Pools
|
|
49
|
+
|
|
50
|
+
| Property | Type | Description |
|
|
51
|
+
| ---------- | ---------- | ---------------------------------------------- |
|
|
52
|
+
| `emojiSet` | `string[]` | Custom emoji list (if set, overrides default). |
|
|
53
|
+
| `wordSet` | `string[]` | Custom word list used in readable/mixed modes. |
|
|
54
|
+
|
|
55
|
+
### Generation Mode
|
|
56
|
+
|
|
57
|
+
| Property | Type | Description |
|
|
58
|
+
| -------- | ---------------- | ---------------------------------------------------------- |
|
|
59
|
+
| `mode` | `RandomMsgModes` | Chooses between `mixed`, `readable`, `chaotic`, `natural`. |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 📖 Grammar Mode (for `natural`)
|
|
64
|
+
|
|
65
|
+
| Property | Type | Description |
|
|
66
|
+
| -------------------- | ---------- | ---------------------------------------------------- |
|
|
67
|
+
| `grammar.templates` | `string[]` | Templates like `"The {adj} {noun} likes to {verb}"`. |
|
|
68
|
+
| `grammar.nouns` | `string[]` | Words to fill `{noun}`. |
|
|
69
|
+
| `grammar.verbs` | `string[]` | Words to fill `{verb}`. |
|
|
70
|
+
| `grammar.adjectives` | `string[]` | Words to fill `{adj}`. |
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## 🔁 Repetition & Emojis
|
|
75
|
+
|
|
76
|
+
| Property | Type | Description |
|
|
77
|
+
| ---------------- | ---------------- | ----------------------------------------- |
|
|
78
|
+
| `repeatWords` | `boolean` | If false, avoids repeating the same word. |
|
|
79
|
+
| `emojiPlacement` | `EmojiPlacement` | Emoji layout preference. |
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 📑 Paragraph Support (Optional)
|
|
84
|
+
|
|
85
|
+
| Property | Type | Description |
|
|
86
|
+
| ---------------- | -------- | ----------------------------- |
|
|
87
|
+
| `paragraphs.min` | `number` | Minimum number of paragraphs. |
|
|
88
|
+
| `paragraphs.max` | `number` | Maximum number of paragraphs. |
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 🧾 Line Generation
|
|
93
|
+
|
|
94
|
+
| Property | Type | Description |
|
|
95
|
+
| ------------------ | -------- | ------------------------------------ |
|
|
96
|
+
| `line.minLength` | `number` | Minimum characters per line. |
|
|
97
|
+
| `line.maxLength` | `number` | Maximum characters per line. |
|
|
98
|
+
| `line.emojiChance` | `number` | Chance (0 to 1) for emojis per line. |
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 🏗️ Constructor
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
new UltraRandomMsgGen(config = {})
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Arguments:
|
|
109
|
+
|
|
110
|
+
* `config`: A partial or full `MsgGenConfig` object to customize generation behavior.
|
|
111
|
+
|
|
112
|
+
### Behavior:
|
|
113
|
+
|
|
114
|
+
* Initializes internal configuration with defaults.
|
|
115
|
+
* Validates all config types and values (length ranges, emoji placement, etc.).
|
|
116
|
+
* Automatically loads default words, emojis, and grammar unless overridden.
|
|
117
|
+
|
|
118
|
+
> ✨ This constructor sets up everything needed for cute, chaotic, or naturally structured nonsense generation!
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## ⚙️ `configure(newConfig)`
|
|
123
|
+
|
|
124
|
+
Merge new configuration values into the current generator settings.
|
|
125
|
+
|
|
126
|
+
* **Parameters:**
|
|
127
|
+
|
|
128
|
+
* `newConfig` *(Object)* — Partial config overrides.
|
|
129
|
+
* **Returns:** `UltraRandomMsgGen` — The instance (for chaining).
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 📝 Grammar Templates & Word Lists Management
|
|
134
|
+
|
|
135
|
+
These methods let you manage the grammar templates and word lists for sentence generation.
|
|
136
|
+
|
|
137
|
+
### Template Methods
|
|
138
|
+
|
|
139
|
+
* **`setGrammarTemplates(...templates)`**
|
|
140
|
+
Replace the entire list of sentence templates.
|
|
141
|
+
*Accepts multiple strings or arrays of strings.*
|
|
142
|
+
|
|
143
|
+
* **`addGrammarTemplates(...templates)`**
|
|
144
|
+
Append new sentence templates to the existing list.
|
|
145
|
+
|
|
146
|
+
* **`removeGrammarTemplates(...templates)`**
|
|
147
|
+
Remove specific templates from the list.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
### Noun Methods
|
|
152
|
+
|
|
153
|
+
* **`setGrammarNouns(...nouns)`**
|
|
154
|
+
Replace the list of nouns.
|
|
155
|
+
|
|
156
|
+
* **`addGrammarNouns(...nouns)`**
|
|
157
|
+
Add new nouns to the list.
|
|
158
|
+
|
|
159
|
+
* **`removeGrammarNouns(...nouns)`**
|
|
160
|
+
Remove specific nouns from the list.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
### Verb Methods
|
|
165
|
+
|
|
166
|
+
* **`setGrammarVerbs(...verbs)`**
|
|
167
|
+
Replace the list of verbs.
|
|
168
|
+
|
|
169
|
+
* **`addGrammarVerbs(...verbs)`**
|
|
170
|
+
Add new verbs.
|
|
171
|
+
|
|
172
|
+
* **`removeGrammarVerbs(...verbs)`**
|
|
173
|
+
Remove verbs from the list.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
### Adjective Methods
|
|
178
|
+
|
|
179
|
+
* **`setGrammarAdjectives(...adjectives)`**
|
|
180
|
+
Replace the list of adjectives.
|
|
181
|
+
|
|
182
|
+
* **`addGrammarAdjectives(...adjectives)`**
|
|
183
|
+
Add adjectives.
|
|
184
|
+
|
|
185
|
+
* **`removeGrammarAdjectives(...adjectives)`**
|
|
186
|
+
Remove adjectives.
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 🗣️ Word Set Management
|
|
191
|
+
|
|
192
|
+
* **`setWords(...words)`**
|
|
193
|
+
Replace the entire word set used in readable/mixed modes.
|
|
194
|
+
|
|
195
|
+
* **`addWords(...words)`**
|
|
196
|
+
Add new words to the existing word set.
|
|
197
|
+
|
|
198
|
+
* **`removeWords(...words)`**
|
|
199
|
+
Remove specific words from the word set.
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## 😄 Emoji Set Management
|
|
204
|
+
|
|
205
|
+
* **`setEmojis(...emojis)`**
|
|
206
|
+
Replace the emoji set used in generation.
|
|
207
|
+
|
|
208
|
+
* **`addEmojis(...emojis)`**
|
|
209
|
+
Add emojis to the current emoji set.
|
|
210
|
+
|
|
211
|
+
* **`removeEmojis(...emojis)`**
|
|
212
|
+
Remove emojis from the current set.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 🎲 Internal Helpers (Private Methods)
|
|
217
|
+
|
|
218
|
+
### `_getRandomItem(array)`
|
|
219
|
+
|
|
220
|
+
Returns a random element from the given array.
|
|
221
|
+
|
|
222
|
+
* **Parameters:**
|
|
223
|
+
|
|
224
|
+
* `array` *(string\[])* — Array to pick from.
|
|
225
|
+
* **Returns:**
|
|
226
|
+
|
|
227
|
+
* *(string)* Random element.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
### `_generateChunk()`
|
|
232
|
+
|
|
233
|
+
Generates a single random chunk of content based on the current mode and settings.
|
|
234
|
+
Chunks can be words, emojis, symbols, numbers, or full sentences (in natural mode).
|
|
235
|
+
|
|
236
|
+
* **Returns:**
|
|
237
|
+
|
|
238
|
+
* *(string)* Random chunk.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
### `_generateNaturalSentence()`
|
|
243
|
+
|
|
244
|
+
Generates a natural-language sentence by filling placeholders (`{noun}`, `{verb}`, `{adj}`) in a random template.
|
|
245
|
+
|
|
246
|
+
* **Returns:**
|
|
247
|
+
|
|
248
|
+
* *(string)* Generated sentence.
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
### `_generateLine(targetLength, seenWords)`
|
|
253
|
+
|
|
254
|
+
Generates a single line of text aiming for `targetLength` characters, applying spacing, casing, and emoji placement rules.
|
|
255
|
+
Avoids repeated words if configured.
|
|
256
|
+
|
|
257
|
+
* **Parameters:**
|
|
258
|
+
|
|
259
|
+
* `targetLength` *(number)* — Desired character length.
|
|
260
|
+
* `seenWords` *(Set<string>)* — Tracks used words to avoid repeats.
|
|
261
|
+
* **Returns:**
|
|
262
|
+
|
|
263
|
+
* *(string)* Generated line.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
### `_generateParagraphLines(totalLength)`
|
|
268
|
+
|
|
269
|
+
Generates multiple lines that together reach approximately `totalLength` characters, building a paragraph.
|
|
270
|
+
|
|
271
|
+
* **Parameters:**
|
|
272
|
+
|
|
273
|
+
* `totalLength` *(number)* — Desired paragraph length in characters.
|
|
274
|
+
* **Returns:**
|
|
275
|
+
|
|
276
|
+
* *(string\[])* Array of generated lines.
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## 🎉 Main Method
|
|
281
|
+
|
|
282
|
+
### `generate()`
|
|
283
|
+
|
|
284
|
+
Generates the final message string using all configured rules.
|
|
285
|
+
May return a multi-paragraph text if paragraph config is set.
|
|
286
|
+
|
|
287
|
+
* **Returns:**
|
|
288
|
+
|
|
289
|
+
* *(string)* The full generated message.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiny-essentials",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "npm run test:mjs && npm run test:cjs && npm run test:js",
|