re2 1.10.5 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc +3 -1
- package/.travis.yml +1 -2
- package/README.md +5 -6
- package/lib/addon.cc +4 -6
- package/lib/wrapped_re2.h +1 -1
- package/package.json +4 -3
package/.prettierrc
CHANGED
package/.travis.yml
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# node-re2
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[![Build status][travis-image]][travis-url]
|
|
4
4
|
[![NPM version][npm-image]][npm-url]
|
|
5
5
|
|
|
6
6
|
[](https://greenkeeper.io/)
|
|
@@ -18,12 +18,14 @@ at his [Implementing Regular Expressions](http://swtch.com/~rsc/regexp/) page.
|
|
|
18
18
|
but it lacks two features: backreferences and lookahead assertions. See below for more details.
|
|
19
19
|
|
|
20
20
|
`RE2` object emulates standard `RegExp` making it a practical drop-in replacement in most cases.
|
|
21
|
-
`RE2` is extended to provide `String`-based regular expression methods as well. To help
|
|
21
|
+
`RE2` is extended to provide `String`-based regular expression methods as well. To help to convert
|
|
22
22
|
`RegExp` objects to `RE2` its constructor can take `RegExp` directly honoring all properties.
|
|
23
23
|
|
|
24
24
|
It can work with [node.js buffers](http://nodejs.org/api/buffer.html) directly reducing overhead
|
|
25
25
|
on recoding and copying characters, and making processing/parsing long files fast.
|
|
26
26
|
|
|
27
|
+
All documentation can be found in this README and in the [wiki](https://github.com/uhop/node-re2/wiki).
|
|
28
|
+
|
|
27
29
|
## Why use node-re2?
|
|
28
30
|
|
|
29
31
|
The built-in Node.js regular expression engine can run in exponential time with a special combination:
|
|
@@ -346,12 +348,9 @@ for your platform, then run:
|
|
|
346
348
|
|
|
347
349
|
npm install
|
|
348
350
|
|
|
349
|
-
Or:
|
|
350
|
-
|
|
351
|
-
yarn
|
|
352
|
-
|
|
353
351
|
## Release history
|
|
354
352
|
|
|
353
|
+
- 1.11.0 *Updated the way to initialize the extension (thx [BannerBomb](https://github.com/BannerBomb)).*
|
|
355
354
|
- 1.10.5 *Bugfix for optional groups (thx [Josh Yudaken](https://github.com/qix)), the latest version of `re2`.*
|
|
356
355
|
- 1.10.4 *Technical release: even better TypeScript types (thx [Louis Brann](https://github.com/louis-brann)).*
|
|
357
356
|
- 1.10.3 *Technical release: missing reference to TS types (thx [Jamie Magee](https://github.com/JamieMagee)).*
|
package/lib/addon.cc
CHANGED
|
@@ -26,7 +26,7 @@ static NAN_METHOD(GetUtf16Length)
|
|
|
26
26
|
info.GetReturnValue().Set(-1);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
void WrappedRE2::Initialize(v8::Local<v8::
|
|
29
|
+
void WrappedRE2::Initialize(v8::Local<v8::Value> module, v8::Local<v8::Context> context)
|
|
30
30
|
{
|
|
31
31
|
|
|
32
32
|
// prepare constructor template
|
|
@@ -65,12 +65,10 @@ void WrappedRE2::Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Object>
|
|
|
65
65
|
ctorTemplate.Reset(tpl);
|
|
66
66
|
|
|
67
67
|
// return constructor as module's export
|
|
68
|
-
Nan::Set(module, Nan::New("exports").ToLocalChecked(), fun);
|
|
68
|
+
Nan::Set(module->ToObject(context).ToLocalChecked(), Nan::New("exports").ToLocalChecked(), fun);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
NODE_MODULE_INIT()
|
|
72
72
|
{
|
|
73
|
-
WrappedRE2::Initialize(
|
|
73
|
+
WrappedRE2::Initialize(module, context);
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
NODE_MODULE(re2, Initialize)
|
package/lib/wrapped_re2.h
CHANGED
|
@@ -48,7 +48,7 @@ private:
|
|
|
48
48
|
static Nan::Persistent<v8::FunctionTemplate> ctorTemplate;
|
|
49
49
|
|
|
50
50
|
public:
|
|
51
|
-
static void Initialize(v8::Local<v8::
|
|
51
|
+
static void Initialize(v8::Local<v8::Value> module, v8::Local<v8::Context> context);
|
|
52
52
|
|
|
53
53
|
static inline bool HasInstance(v8::Local<v8::Object> object)
|
|
54
54
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "re2",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Bindings for RE2: fast, safe alternative to backtracking regular expression engines.",
|
|
5
5
|
"homepage": "http://github.com/uhop/node-re2",
|
|
6
6
|
"bugs": "http://github.com/uhop/node-re2/issues",
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
"test": "tests"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"nan": "^2.14.
|
|
13
|
+
"nan": "^2.14.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"heya-unit": "^0.3.0"
|
|
16
|
+
"heya-unit": "^0.3.0",
|
|
17
|
+
"node-gyp": "^6.1.0"
|
|
17
18
|
},
|
|
18
19
|
"scripts": {
|
|
19
20
|
"test": "node tests/tests.js"
|