toosoon-utils 1.0.1 → 1.0.3
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/README.md +8 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# TOOSOON UTILS
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
|
|
5
3
|
TOOSOON utility functions.
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
@@ -15,7 +13,7 @@ $ yarn add toosoon-utils
|
|
|
15
13
|
NPM:
|
|
16
14
|
|
|
17
15
|
```properties
|
|
18
|
-
$
|
|
16
|
+
$ npm install toosoon-utils
|
|
19
17
|
```
|
|
20
18
|
|
|
21
19
|
## Usage
|
|
@@ -143,7 +141,7 @@ createCanvas(width: number, height: number) => { canvas: HTMLCanvasElement; ctx:
|
|
|
143
141
|
injectStyles(cssContent: string) => void;
|
|
144
142
|
```
|
|
145
143
|
|
|
146
|
-
###
|
|
144
|
+
### Files
|
|
147
145
|
|
|
148
146
|
```ts
|
|
149
147
|
// Download a Blob object into user files
|
|
@@ -155,7 +153,7 @@ download(blob: Blob, filename: string) => void;
|
|
|
155
153
|
upload(onLoad: (dataUrl: string) => void, accept?: string) => void;
|
|
156
154
|
```
|
|
157
155
|
|
|
158
|
-
###
|
|
156
|
+
### Functions
|
|
159
157
|
|
|
160
158
|
```ts
|
|
161
159
|
// No-op function
|
|
@@ -172,7 +170,7 @@ wait(timeout: number) => Promise<void>;
|
|
|
172
170
|
defer<T>() => Deferred<T>;
|
|
173
171
|
```
|
|
174
172
|
|
|
175
|
-
###
|
|
173
|
+
### Geometry
|
|
176
174
|
|
|
177
175
|
```ts
|
|
178
176
|
// Convert a radians value into degrees
|
|
@@ -219,7 +217,7 @@ cover(target: FitInput, container: FitInput) => FitOutput;
|
|
|
219
217
|
contain(target: FitInput, container: FitInput) => FitOutput;
|
|
220
218
|
```
|
|
221
219
|
|
|
222
|
-
###
|
|
220
|
+
### Maths
|
|
223
221
|
|
|
224
222
|
```ts
|
|
225
223
|
// Check if a number is even
|
|
@@ -316,14 +314,14 @@ average(array: number[]) => number;
|
|
|
316
314
|
damp(value: number, target: number, damping: number, delta: number) => number;
|
|
317
315
|
```
|
|
318
316
|
|
|
319
|
-
###
|
|
317
|
+
### Now
|
|
320
318
|
|
|
321
319
|
```ts
|
|
322
320
|
// Polyfill for "now()" functions
|
|
323
321
|
now() => number;
|
|
324
322
|
```
|
|
325
323
|
|
|
326
|
-
###
|
|
324
|
+
### Random
|
|
327
325
|
|
|
328
326
|
```ts
|
|
329
327
|
// Generate a random boolean (true or false)
|
|
@@ -385,7 +383,7 @@ onSphere(radius?: number, target?: Vector3) => Vector3;
|
|
|
385
383
|
insideSphere(radius?: number, target?: Vector3) => Vector3;
|
|
386
384
|
```
|
|
387
385
|
|
|
388
|
-
###
|
|
386
|
+
### Strings
|
|
389
387
|
|
|
390
388
|
```ts
|
|
391
389
|
// Capitalize a string
|