markov-strings
Advanced tools
Comparing version 2.1.0 to 2.1.1
export declare type MarkovGenerateOptions = { | ||
maxTries?: number; | ||
prng?: any; | ||
prng?: () => number; | ||
filter?: (result: MarkovResult) => boolean; | ||
@@ -5,0 +5,0 @@ }; |
{ | ||
"name": "markov-strings", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "A Markov string generator", | ||
@@ -30,13 +30,13 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/jest": "^24.0.15", | ||
"@types/lodash": "^4.14.136", | ||
"@types/node": "^12.6.2", | ||
"coveralls": "^3.0.5", | ||
"jest": "^24.8.0", | ||
"ts-jest": "^24.0.2", | ||
"typescript": "^3.5.3" | ||
"@types/jest": "^25.1.3", | ||
"@types/lodash": "^4.14.149", | ||
"@types/node": "^13.7.7", | ||
"coveralls": "^3.0.9", | ||
"jest": "^25.1.0", | ||
"ts-jest": "^25.3.0", | ||
"typescript": "^3.8.3" | ||
}, | ||
"dependencies": { | ||
"lodash": "^4.17.14" | ||
"lodash": "^4.17.15" | ||
} | ||
} |
import { assignIn, cloneDeep, flatten, includes, isEmpty, isString, slice, some, uniqBy } from 'lodash' | ||
function sampleWithPRNG (array: Array<any>, prng: any = Math.random) { | ||
function sampleWithPRNG<T>(array: T[], prng: () => number = Math.random): T | undefined { | ||
const length = array == null ? 0 : array.length | ||
@@ -10,3 +10,3 @@ return length ? array[Math.floor(prng() * length)] : undefined | ||
maxTries?: number, | ||
prng?: any, | ||
prng?: () => number, | ||
filter?: (result: MarkovResult) => boolean | ||
@@ -13,0 +13,0 @@ } |
35965
Updatedlodash@^4.17.15