randexp
Advanced tools
Comparing version 0.5.2 to 0.5.3
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
const ret = require('ret'); | ||
@@ -4,0 +2,0 @@ const DRange = require('drange'); |
@@ -11,3 +11,3 @@ { | ||
], | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"homepage": "http://fent.github.io/randexp.js/", | ||
@@ -21,7 +21,9 @@ "repository": { | ||
"files": [ | ||
"lib" | ||
"lib", | ||
"types/index.d.ts" | ||
], | ||
"scripts": { | ||
"version": "gulp build && git add build", | ||
"test": "istanbul cover node_modules/.bin/_mocha -- test/*-test.js" | ||
"test": "istanbul cover node_modules/.bin/_mocha -- test/*-test.js", | ||
"dtslint": "dtslint types --onlyTestTsNext" | ||
}, | ||
@@ -32,3 +34,3 @@ "directories": { | ||
"dependencies": { | ||
"drange": "^1.0.0", | ||
"drange": "^1.0.2", | ||
"ret": "^0.2.0" | ||
@@ -50,3 +52,4 @@ }, | ||
}, | ||
"license": "MIT" | ||
"license": "MIT", | ||
"types": "./types" | ||
} |
@@ -76,3 +76,3 @@ # randexp.js | ||
The default randomness is provided by `Math.random()`. If you need to use a seedable or cryptographic PRNG, you | ||
can override `RandExp.prottoype.randInt` or `randexp.randInt` (where `randexp` is an instance of `RandExp`). `randInt(from, to)` accepts an inclusive range and returns a randomly selected number within that range. | ||
can override `RandExp.prototype.randInt` or `randexp.randInt` (where `randexp` is an instance of `RandExp`). `randInt(from, to)` accepts an inclusive range and returns a randomly selected number within that range. | ||
@@ -132,1 +132,16 @@ # Infinite Repetitionals | ||
``` | ||
# Integration with TypeScript | ||
RandExp includes TypeScript definitions. | ||
```typescript | ||
import * as RandExp from "randexp"; | ||
const randexp = new RandExp(/[a-z]{6}/); | ||
randexp.gen(); | ||
``` | ||
Use dtslint to check the definition file. | ||
npm install -g dtslint | ||
npm run dtslint |
13659
5
231
146
Updateddrange@^1.0.2