Skip to content

Commit

Permalink
Release v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rudashi committed Mar 10, 2023
1 parent b488511 commit b6bc55e
Show file tree
Hide file tree
Showing 5 changed files with 740 additions and 75 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [1.4.0](https://github.com/rudashi/stringable/compare/v1.3.1...v1.4.0) (2023-03-10)

### Feature
* Add `of` method to `Str`
* Add `str` function

### Refactor
* Extracted static methods from `Stringable` to `methods` and `Str`

## [1.3.1](https://github.com/rudashi/stringable/compare/v1.3.0...v1.3.1) (2023-03-06)

### Feature
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ chain multiple string operations together using a more readable syntax compared
List of all fluent methods you can find [here](docs/methods.md#fluent-methods).

## Strings methods
- [Str.preg_quote](docs/methods.md#strpregquote)
- [Str.random](docs/methods.md#strrandom)
- [Str.createRandomStringsUsing](docs/methods.md#strcreaterandomstringsusing)
- [Str.createRandomStringsUsingSequence](docs/methods.md#strcreaterandomstringsusingsequence)
- [Str.createRandomStringsNormally](docs/methods.md#strcreaterandomstringsnormally)
- [Str.substr](docs/methods.md#strsubstr)
- [Str.ulid](docs/methods.md#strulid)
- [Str.uuid](docs/methods.md#struuid)
List of all static methods you can find [here](docs/statics.md#strings).

## TO DO
- [charAt](docs/methods.md#charat)
- [isMatch](docs/methods.md#ismatch)
- [plural](docs/methods.md#plural)
- [singular](docs/methods.md#singular)
- [Str.orderedUuid](docs/methods.md#strordereduuid)

and for `Str`
- [charAt](docs/statics.md#charat)
- [isMatch](docs/statics.md#ismatch)
- [password](docs/statics.md#password)
- [orderedUuid](docs/statics.md#ordereduuid)

## Changelog

Expand Down
71 changes: 6 additions & 65 deletions docs/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [beforeLast](#beforelast)
- [between](#between)
- [betweenFirst](#betweenfirst)
- [charAt](#charat)
- [camel](#camel)
- [contains](#contains)
- [containsAll](#containsall)
Expand All @@ -29,6 +30,7 @@
- [isJson](#isjson)
- [isUlid](#isulid)
- [isUuid](#isuuid)
- [isMatch](#ismatch)
- [kebab](#kebab)
- [lcfirst](#lcfirst)
- [length](#length)
Expand Down Expand Up @@ -167,6 +169,8 @@ Stringable.of('[a] bc [d]').betweenFirst('[', ']');

// 'a'
```
### charAt
Not implemented
### camel
The `camel` method converts the given string to `camelCase`:
```js
Expand Down Expand Up @@ -381,6 +385,8 @@ Stringable.of('Taylor').isUuid();

// false
```
### isMatch
Not Implemented
### kebab
The `kebab` method converts the given string to `kebab-case`:
```js
Expand Down Expand Up @@ -994,69 +1000,4 @@ The `value` method returns the underlying string value.
Stringable.of('foo').value();

// 'foo'
```
## Strings
### Str.orderedUuid
Not implemented
### Str.preg_quote
The `Str.preg_quote` method quote regular expression characters:
```js
Str.preg_quote('*RRRING* Hello?');

// '\*RRRING\* Hello\?'
```
### Str.random
The `Str.random` method generates a random string of the specified length:
```js
Str.random(40);
```
### Str.createRandomStringsUsing
The `Str.createRandomStringsUsing` method allows to intercept and control the random string generation.
```js
Str.createRandomStringsUsing((length) => `xyz|${length}`);
Str.random(7);

// 'xyz:7'
```
### Str.createRandomStringsUsingSequence
The `Str.createRandomStringsUsingSequence` method allows to set a sequence that will be used to generate random strings.
```js
Str.createRandomStringsUsingSequence({0: 'x', 2: 'y', 3: 'z'});

Str.random();
// 'x'
Str.random();
// random String
Str.random();
// 'y'
```
### Str.createRandomStringsNormally
The `Str.createRandomStringsNormally` method resets to default random string generator.
```js
Str.createRandomStringsUsing((length) => `xyz|${length}`);
Str.createRandomStringsNormally();
Str.random(7);

// random 7 characters
```
### Str.substr
The `Str.substr` method returns the portion of string specified by the start and length parameters:
```js
Str.substr('The Laravel Framework', 4, 7);

// 'Laravel'
```
### Str.uuid
The `Str.uuid` method generates a UUID (version 4):
```js
Str.uuid();

// Stringable object
```
### Str.ulid
The `Str.ulid` method generates a ULID:
```js
Str.ulid();

// Stringable object
```
Loading

0 comments on commit b6bc55e

Please sign in to comment.