Skip to content

Commit

Permalink
updating tests, readme, and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
karnthis committed Feb 23, 2022
1 parent 96fd2bb commit 765ef92
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 12 deletions.
11 changes: 10 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<!-- ## [Unreleased] -->

## Major Releases:
### [v2.0.0] - 2022 02 22
#### Added
- New random word generator:
- `randomEnglish()` Generates text block with specified number of random English words.
#### Changed
- Introducing Types! We have converted to Typescript, and it is good.
- Added input sanitization to several functions that were missing it.

### [v1.0.0] - 2019 06 23
#### Added
- Two random string functions:
Expand Down Expand Up @@ -81,7 +89,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- LINKS -->
<!-- RELEASES -->
[Unreleased]: https://github.com/karnthis/make-random/compare/v1.3.0...dev
[Unreleased]: https://github.com/karnthis/make-random/compare/v2.0.0...dev
[v2.0.0]: https://github.com/karnthis/make-random/compare/v1.3.0...2.0.0
[v1.3.0]: https://github.com/karnthis/make-random/compare/v1.2.2...v1.3.0
[v1.2.2]: https://github.com/karnthis/make-random/compare/v1.2.0...v1.2.2
[v1.2.0]: https://github.com/karnthis/make-random/compare/v1.1.0...v1.2.0
Expand Down
29 changes: 22 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ npm install make-random
- [randomString()](#randomString)
- [randomCaseString()](#randomCaseString)
- [randomLatin()](#randomLatin)
- [randomEnglish()](#randomEnglish)
- [randomUUID()](#randomUUID)

__All ranges are inclusive of the passed value(s)__
Expand Down Expand Up @@ -194,6 +195,26 @@ randomLatin('20')
.then(resp => console.log(resp))
```

### randomEnglish()

The `randomEnglish()` method accepts an optional integer or integer-like argument. It returns a string with the specified number of random latin words. If no argument is given, method defaults to 5 words. All words start with E or R.

```javascript
const { randomEnglish } = require('make-random')

// Return string with 5 random words
randomEnglish()
.then(resp => console.log(resp))

// Return string with 12 random words
randomEnglish(12)
.then(resp => console.log(resp))

// Accept integer or integer-like string
randomEnglish('20')
.then(resp => console.log(resp))
```

### randomUUID()

The `randomUUID()` method generates v4-compliant CSPRNG UUID
Expand All @@ -207,19 +228,13 @@ randomUUID()
.then(resp => console.log(resp))
```

## Deprecated

### Make-Random-Legacy

The old methods `makeRandom.ceil()` and `makeRandom.floor()` have been discontined and removed. If continued use is needed and the new `random()` will not meet your needs, please switch to [make-random-legacy](https://github.com/karnthis/make-random-legacy) or consider submitting a feature request or PR.

## License

The MIT License (MIT)

Copyright (c) 2016 John Foderaro

Copyright (c) 2019 Erin Rivas
Copyright (c) 2019-2022 Erin Rivas

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
2 changes: 1 addition & 1 deletion test/main/integer.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const { expect } = require('chai');
const { random, randomInRange } = require('../../src/libs');
const { random, randomInRange } = require('../../dist/libs');

describe('random()', () => {
it(`should be a function`, ()=> {
Expand Down
2 changes: 1 addition & 1 deletion test/main/string.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const { expect } = require('chai');
const { randomAZString, randomString } = require('../../src/libs');
const { randomAZString, randomString } = require('../../dist/libs');

describe('randomAZString()', () => {
it(`should be a function`, ()=> {
Expand Down
2 changes: 1 addition & 1 deletion test/main/uuid.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const chai = require('chai');
const { expect } = chai;
chai.use(require('chai-uuid'));
const { randomUUID } = require('../../src/libs');
const { randomUUID } = require('../../dist/libs');

describe('randomUUID()', () => {
it(`should be a function`, ()=> {
Expand Down
2 changes: 1 addition & 1 deletion test/main/words.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const { expect } = require('chai');
const { randomLatin } = require('../../src/libs');
const { randomLatin } = require('../../dist/libs');

describe('randomLatin()', () => {
it(`should be a function`, ()=> {
Expand Down

0 comments on commit 765ef92

Please sign in to comment.