fix(core): update
This commit is contained in:
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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');
|
||||
|
||||
|
Reference in New Issue
Block a user