Skip to content

Commit

Permalink
feat(string): use RandomGenerator as the base class
Browse files Browse the repository at this point in the history
  • Loading branch information
richrdkng committed Aug 19, 2023
1 parent d4e635c commit 91a1c0d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 39 deletions.
67 changes: 41 additions & 26 deletions packages/string/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions packages/string/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@
"@types/jest": "^29.5.3",
"@types/node": "^16.18.38",
"@types/semantic-release": "^20.0.1",
"jest": "^29.6.1",
"jest-extended": "^4.0.0",
"rollup": "^3.26.3",
"jest": "^29.6.2",
"jest-extended": "^4.0.1",
"rollup": "^3.28.0",
"semantic-release": "^19.0.5",
"semantic-release-monorepo": "^7.0.5",
"snazzy": "^9.0.0",
"string-dedent": "^3.0.1",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"ts-standard": "^12.0.2",
"tslib": "^2.6.0",
"tslib": "^2.6.2",
"typescript": "^4.9.4"
},
"dependencies": {
"@grandom/core": "^1.6.0",
"@grandom/engines": "^1.0.2"
"@grandom/core": "^2.4.0",
"@grandom/engines": "^2.1.0"
}
}
13 changes: 6 additions & 7 deletions packages/string/src/RandomString/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

// TODO: implement edge cases (including infinite loops)
// TODO: implement detailed error handling

import { RandomEngine } from '@grandom/core'
import { RandomGenerator } from '@grandom/core'
import { type Filter } from '../StringFilter'

export interface ConfigOptions {
Expand All @@ -22,7 +21,7 @@ type RandomStringOptions = {
}
} & ConfigOptions

export default class RandomString {
export default class RandomString extends RandomGenerator {
/**
* The default length of a random string.
*
Expand Down Expand Up @@ -53,11 +52,11 @@ export default class RandomString {

// ---------------------------------------------------------------------------

private readonly _engine: RandomEngine
// private readonly _engine: RandomEngine

constructor (engine: RandomEngine) {
this._engine = engine
}
// constructor (engine: RandomEngine) {
// this._engine = engine
// }

// ---------------------------------------------------------------------------

Expand Down

0 comments on commit 91a1c0d

Please sign in to comment.