fix(core): update

This commit is contained in:
2019-04-16 08:55:37 +02:00
parent c92ece79ff
commit 95d5c6ceee
8 changed files with 39 additions and 63 deletions

View File

@ -2,12 +2,12 @@ import * as plugins from './smartstring.plugins';
/**
* creates a random string
*
*
* ```ts
* createRandomString('AAAA')
* //=> 'AGHR'
* //=> 'AGHR'
* ```
*
*
* @param patternArg the pattern argument to use, Aa0!* are viable pattern descritors
* @param lengthArg the length of the random string
* @param optionsArg options

View File

@ -46,7 +46,7 @@ export class Domain {
// helper functions
/** */
private _domainRegex (stringArg: string) {
private _domainRegex(stringArg: string) {
const regexString = /([a-zA-Z0-9\-\_]*)\.{0,1}([a-zA-Z0-9\-\_]*)\.{0,1}([a-zA-Z0-9\-\_]*)\.{0,1}([a-zA-Z0-9\-\_]*)\.{0,1}([a-zA-Z0-9\-\_]*)\.{0,1}$/;
const regexMatches = regexString.exec(stringArg);
regexMatches.reverse(); //make sure we build the domain from toplevel to subdomain (reversed order)
@ -57,7 +57,7 @@ export class Domain {
return regexMatchesFiltered;
}
private _protocolRegex (stringArg: string) {
private _protocolRegex(stringArg: string) {
const regexString = /^([a-zA-Z0-9]*):\/\//;
const regexMatches = regexString.exec(stringArg);
if (regexMatches) {
@ -67,7 +67,7 @@ export class Domain {
}
}
private _portRegex (stringArg: string) {
private _portRegex(stringArg: string) {
const regexString = /^([a-zA-Z0-9]*):\/\//;
const regexMatches = regexString.exec(stringArg);
if (regexMatches) {
@ -76,5 +76,4 @@ export class Domain {
return undefined;
}
}
}

View File

@ -2,10 +2,7 @@
import * as crypto from 'crypto';
import * as url from 'url';
export {
crypto,
url
};
export { crypto, url };
// third party
export let jsBase64 = require('js-base64').Base64;
@ -14,4 +11,3 @@ export let stripIndent = require('strip-indent');
export let normalizeNewline = require('normalize-newline');
export let randomatic = require('randomatic');
export let cryptoRandomString = require('crypto-random-string');