add ability to call self-signed or invalid certificate clients

This commit is contained in:
Joel Male
2021-02-26 13:58:33 +10:00
parent 528d756289
commit 9380ee26ff
3852 changed files with 253796 additions and 137756 deletions
+28
View File
@@ -0,0 +1,28 @@
declare namespace astralRegex {
interface Options {
/**
Only match an exact string. Useful with `RegExp#test()` to check if a string is a astral symbol. Default: `false` _(Matches any astral symbols in a string)_
*/
readonly exact?: boolean;
}
}
/**
Regular expression for matching [astral symbols](https://everything2.com/title/astral+plane).
@returns A `RegExp` for matching astral symbols.
@example
```
import astralRegex = require('astral-regex');
astralRegex({exact: true}).test('🦄');
//=> true
'foo 🦄 💩 bar'.match(astralRegex());
//=> ['🦄', '💩']
```
*/
declare function astralRegex(options?: astralRegex.Options): RegExp;
export = astralRegex;
+3 -1
View File
@@ -1,4 +1,6 @@
'use strict';
const regex = '[\uD800-\uDBFF][\uDC00-\uDFFF]';
module.exports = opts => opts && opts.exact ? new RegExp(`^${regex}$`) : new RegExp(regex, 'g');
const astralRegex = options => options && options.exact ? new RegExp(`^${regex}$`) : new RegExp(regex, 'g');
module.exports = astralRegex;
+8 -7
View File
@@ -1,6 +1,6 @@
{
"name": "astral-regex",
"version": "1.0.0",
"version": "2.0.0",
"description": "Regular expression for matching astral symbols",
"license": "MIT",
"repository": "kevva/astral-regex",
@@ -10,13 +10,14 @@
"url": "github.com/kevva"
},
"engines": {
"node": ">=4"
"node": ">=8"
},
"scripts": {
"test": "xo && ava"
"test": "xo && ava && tsd"
},
"files": [
"index.js"
"index.js",
"index.d.ts"
],
"keywords": [
"astral",
@@ -24,9 +25,9 @@
"regex",
"surrogate"
],
"dependencies": {},
"devDependencies": {
"ava": "*",
"xo": "*"
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}
+5 -2
View File
@@ -1,6 +1,6 @@
# astral-regex [![Build Status](https://travis-ci.org/kevva/astral-regex.svg?branch=master)](https://travis-ci.org/kevva/astral-regex)
> Regular expression for matching astral symbols
> Regular expression for matching [astral symbols](https://everything2.com/title/astral+plane)
## Install
@@ -15,8 +15,11 @@ $ npm install astral-regex
```js
const astralRegex = require('astral-regex');
astralRegex({exact: true}).test('');
astralRegex({exact: true}).test('🦄');
//=> true
'foo 🦄 💩 bar'.match(astralRegex());
//=> ['🦄', '💩']
```