add create module

This commit is contained in:
2017-10-11 14:52:22 +02:00
parent 83279a9c19
commit 099bf9b270
16 changed files with 79 additions and 8 deletions

View File

@ -1,9 +1,11 @@
import * as create from './smartstring.create'
import * as docker from './smartstring.docker'
import * as indent from './smartstring.indent'
import * as normalize from './smartstring.normalize'
import * as typescript from './smartstring.typescript'
export {
create,
docker,
typescript,
normalize,

13
ts/smartstring.create.ts Normal file
View File

@ -0,0 +1,13 @@
import * as plugins from './smartstring.plugins'
export let createRandomString = (
patternArg: string,
lengthArg: number,
optionsArg: any
): string => {
return plugins.randomatic(patternArg, lengthArg, optionsArg)
}
export let createCryptoRandomString = (lengthArg): string => {
return plugins.cryptoRandomString(lengthArg)
}

View File

@ -13,7 +13,7 @@ export class Domain {
topLevel: string
domainName
subDomain
constructor(domainStringArg: string) {
constructor (domainStringArg: string) {
let regexMatches = domainRegex(domainStringArg);
this.fullName = ''
for (let i = 1; i <= 5; i++) {

View File

@ -3,3 +3,5 @@ export let jsBase64 = require('js-base64').Base64
export let stripIndent = require('strip-indent')
export let normalizeNewline = require('normalize-newline')
export let randomatic = require('randomatic')
export let cryptoRandomString = require('crypto-random-string')