Skip to content

Commit

Permalink
Release 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wzhouwzhou committed Nov 22, 2017
1 parent ca3cffd commit 46ae584
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,15 @@ exports.hello = require(exports.hellop);

delete require.cache[require.resolve(exports.arraysp)];
const { ArrayUtil } = require(exports.arraysp);
const AU_default = ArrayUtil(!0);
Object.defineProperty(ArrayUtil, 'sample', {
value: AU_default.sample.bind(this && this.constructor === ArrayUtil ? this : AU_default),
enumerable: !0,
});
Object.defineProperty(ArrayUtil, 'shuffle', {
value: AU_default.shuffle.bind(this && this.constructor === ArrayUtil ? this : AU_default),
enumerable: !0,
});

exports.ArrayUtil = ArrayUtil;
exports.arrays = ArrayUtil;
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nodecpp-test",
"version": "1.2.1b",
"version": "1.2.2",
"description": "Some utilities written in c++",
"main": "index.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions src/headers/arrayutil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ namespace arrays {
class ArrayUtil : public node::ObjectWrap {
public:
static void Init(v8::Local<v8::Object> exports);
static void Shuffle(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Sample(const v8::FunctionCallbackInfo<v8::Value>& args);

private:
explicit ArrayUtil(bool safe);
~ArrayUtil();

static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Shuffle(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Sample(const v8::FunctionCallbackInfo<v8::Value>& args);

static v8::Persistent<v8::Function> constructor;
bool safe_;
};
Expand Down

0 comments on commit 46ae584

Please sign in to comment.