mirror of
https://github.com/joelwmale/webhook-action.git
synced 2026-08-31 00:19:45 +08:00
add ability to call self-signed or invalid certificate clients
This commit is contained in:
+28
@@ -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
@@ -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
@@ -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
@@ -1,6 +1,6 @@
|
||||
# astral-regex [](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());
|
||||
//=> ['🦄', '💩']
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user