Skip to content

Commit 5f44bce

Browse files
committed
Release v1.4.2
1 parent 0c09bb3 commit 5f44bce

File tree

8 files changed

+37
-4
lines changed

8 files changed

+37
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [1.4.2](https://github.com/rudashi/stringable/compare/v1.4.1...v1.4.2) (2023-04-08)
2+
3+
### Feature
4+
* Add `password` method to `Str
5+
16
## [1.4.1](https://github.com/rudashi/stringable/compare/v1.4.0...v1.4.1) (2023-03-18)
27

38
### Feature

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ List of all static methods you can find [here](docs/statics.md#strings).
7272
- [singular](docs/methods.md#singular)
7373

7474
and for `Str`
75-
- [password](docs/statics.md#password)
7675
- [orderedUuid](docs/statics.md#ordereduuid)
7776

7877
## Changelog

dist/Str.js

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Str.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/statics.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,17 @@ Str.parseCallback('Class@method');
439439
// ['Class', 'method']
440440
```
441441
### password
442-
Not implemented
442+
The `password` method may be used to generate a secure, random password of a given length. The password will consist
443+
of a combination of letters, numbers, symbols, and spaces. By default, passwords are 32 characters long.
444+
```js
445+
Str.password();
446+
447+
// 'EbJo2vE-AS:U,$%_gkrV4n,q~1xy/-_4'
448+
449+
Str.password(12);
450+
451+
// 'qwuar>#V|i]N'
452+
```
443453
### random
444454
The `random` function generates a random string of the specified length:
445455
```js

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stringable-laravel",
3-
"version": "1.4.1",
3+
"version": "1.4.2",
44
"description": "Javascript Version's of Laravel's Illuminate\\Support\\Str",
55
"main": "dist/index.js",
66
"types": "types/index.d.ts",

types/Str.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export declare const Str: {
5454
padLeft: (value: string, length?: number, pad?: string) => string;
5555
padRight: (value: string, length?: number, pad?: string) => string;
5656
parseCallback: (callback: string, method?: string | null) => (string | null)[];
57+
password: (length?: number, letters?: boolean, numbers?: boolean, symbols?: boolean) => string;
5758
random: (length?: number) => string;
5859
createRandomStringsUsing: (callable: Callable) => void;
5960
createRandomStringsUsingSequence: (sequence: AssociativeArray, whenMissing?: Callable) => void;

types/Stringable.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export declare const str: (string?: string) => Stringable | {
5252
padLeft: (value: string, length?: number, pad?: string) => string;
5353
padRight: (value: string, length?: number, pad?: string) => string;
5454
parseCallback: (callback: string, method?: string | null) => (string | null)[];
55+
password: (length?: number, letters?: boolean, numbers?: boolean, symbols?: boolean) => string;
5556
random: (length?: number) => string;
5657
createRandomStringsUsing: (callable: import("./Str").Callable) => void;
5758
createRandomStringsUsingSequence: (sequence: import("./Str").AssociativeArray, whenMissing?: import("./Str").Callable) => void;

0 commit comments

Comments
 (0)