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 CHANGED
@@ -1,5 +1,7 @@
1
1
  {
2
2
  "printWidth": 160,
3
3
  "singleQuote": true,
4
- "bracketSpacing": false
4
+ "bracketSpacing": false,
5
+ "arrowParens": "avoid",
6
+ "trailingComma": "none"
5
7
  }
package/.travis.yml CHANGED
@@ -3,10 +3,9 @@ sudo: false
3
3
  language: node_js
4
4
 
5
5
  node_js:
6
- - "8"
7
6
  - "10"
8
7
  - "12"
9
- - "13"
8
+ - "14"
10
9
 
11
10
  addons:
12
11
  apt:
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # node-re2
2
2
 
3
- <!-- [![Build status][travis-image]][travis-url] -->
3
+ [![Build status][travis-image]][travis-url]
4
4
  [![NPM version][npm-image]][npm-url]
5
5
 
6
6
  [![Greenkeeper badge](https://badges.greenkeeper.io/uhop/node-re2.svg)](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 converting
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::Object> exports, v8::Local<v8::Object> module)
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
- void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Object> module)
71
+ NODE_MODULE_INIT()
72
72
  {
73
- WrappedRE2::Initialize(exports, module);
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::Object> exports, v8::Local<v8::Object> module);
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.10.5",
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.0"
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"