jaypie 1.0.35 → 1.0.37
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 +18 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -532,6 +532,10 @@ argument = force.string(argument);
|
|
|
532
532
|
|
|
533
533
|
Case-insensitive search inside `searchObject` for `headerKey`. Also looks in `header` and `headers` child object of `searchObject`, if `headerKey` not found at top-level.
|
|
534
534
|
|
|
535
|
+
#### `getObjectKeyCaseInsensitive(object:object, key:string)`
|
|
536
|
+
|
|
537
|
+
Case-insensitive search for `key` in `object`. Returns the value of the key or `undefined`.
|
|
538
|
+
|
|
535
539
|
#### `placeholders`
|
|
536
540
|
|
|
537
541
|
Lightweight string interpolation
|
|
@@ -545,6 +549,10 @@ const string = placeholders("Hello, {name}!", { name: "World" });
|
|
|
545
549
|
|
|
546
550
|
The code for placeholders was written by Chris Ferdinandi and distributed under the MIT License in 2018-2019. Their web site is https://gomakethings.com
|
|
547
551
|
|
|
552
|
+
#### `safeParseFloat`
|
|
553
|
+
|
|
554
|
+
`parseFloat` that returns `0` for `NaN`
|
|
555
|
+
|
|
548
556
|
#### `sleep`
|
|
549
557
|
|
|
550
558
|
`sleep` is a promise-based `setTimeout` that resolves after a specified number of milliseconds. It will NOT run when `NODE_ENV` is `test`. See `sleepAlways` for a version that will run in tests.
|
|
@@ -557,6 +565,16 @@ await sleep(2000);
|
|
|
557
565
|
|
|
558
566
|
_This is "bad code" because it checks `NODE_ENV` during runtime. The "right way" is to let sleep run and mock it in tests, in practice this is needless boilerplate. A fair compromise would be to mock `sleep` with `@jaypie/testkit` but not all projects include that dependency. Jaypie will trade academically incorrect for human convenience and simplicity._
|
|
559
567
|
|
|
568
|
+
#### `uuid`
|
|
569
|
+
|
|
570
|
+
The `v4` function from the `uuid` package
|
|
571
|
+
|
|
572
|
+
```javascript
|
|
573
|
+
import { uuid } from "jaypie";
|
|
574
|
+
|
|
575
|
+
const id = uuid();
|
|
576
|
+
```
|
|
577
|
+
|
|
560
578
|
#### `validate`
|
|
561
579
|
|
|
562
580
|
```javascript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jaypie",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.37",
|
|
4
4
|
"author": "Finlayson Studio",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@jaypie/aws": "^1.0.8",
|
|
31
|
-
"@jaypie/core": "^1.0.
|
|
31
|
+
"@jaypie/core": "^1.0.38",
|
|
32
32
|
"@jaypie/datadog": "^1.0.3",
|
|
33
|
-
"@jaypie/express": "^1.0.
|
|
33
|
+
"@jaypie/express": "^1.0.7",
|
|
34
34
|
"@jaypie/lambda": "^1.0.9",
|
|
35
35
|
"@jaypie/mongoose": "^1.0.9"
|
|
36
36
|
},
|