🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

zstack-constants

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zstack-constants - npm Package Compare versions

Comparing version
0.0.6
to
0.1.0
+2
-5
layer/af.js

@@ -1,7 +0,4 @@

var fs = require('fs'),
path = require('path'),
COMMON = require('./common');
var COMMON = require('./common'),
AF = require('./defs/af.json');
var AF = JSON.parse(fs.readFileSync(path.join(__dirname, 'defs', 'af.json')));
AF = Object.assign(AF, {

@@ -8,0 +5,0 @@ cmdStatus: COMMON.cmdStatus,

@@ -1,4 +0,24 @@

var fs = require('fs'),
path = require('path');
// polyfill for ES5
if (typeof Object.assign != 'function') {
Object.assign = function(target) {
'use strict';
if (target == null) {
throw new TypeError('Cannot convert undefined or null to object');
}
module.exports = JSON.parse(fs.readFileSync(path.join(__dirname, 'defs', 'common.json')));
target = Object(target);
for (var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if (source != null) {
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
}
return target;
};
}
module.exports = require('./defs/common.json');

@@ -1,4 +0,1 @@

var fs = require('fs'),
path = require('path');
module.exports = JSON.parse(fs.readFileSync(path.join(__dirname, 'defs', 'dbg.json')));
module.exports = require('./defs/dbg.json');

@@ -1,7 +0,4 @@

var fs = require('fs'),
path = require('path'),
COMMON = require('./common');
var COMMON = require('./common'),
MAC = require('./defs/mac.json');
var MAC = JSON.parse(fs.readFileSync(path.join(__dirname, 'defs', 'mac.json')));
MAC = Object.assign(MAC, {

@@ -8,0 +5,0 @@ cmdStatus: COMMON.cmdStatus,

@@ -1,7 +0,4 @@

var fs = require('fs'),
path = require('path'),
COMMON = require('./common');
var COMMON = require('./common'),
SAPI = require('./defs/sapi.json');
var SAPI = JSON.parse(fs.readFileSync(path.join(__dirname, 'defs', 'sapi.json')));
SAPI = Object.assign(SAPI, {

@@ -8,0 +5,0 @@ cmdStatus: COMMON.cmdStatus,

@@ -1,7 +0,4 @@

var fs = require('fs'),
path = require('path'),
COMMON = require('./common');
var COMMON = require('./common'),
SYS = require('./defs/sys.json');
var SYS = JSON.parse(fs.readFileSync(path.join(__dirname, 'defs', 'sys.json')));
SYS = Object.assign(SYS, {

@@ -8,0 +5,0 @@ cmdStatus: COMMON.cmdStatus,

@@ -1,7 +0,4 @@

var fs = require('fs'),
path = require('path'),
COMMON = require('./common');
var COMMON = require('./common'),
UTIL = require('./defs/util.json');
var UTIL = JSON.parse(fs.readFileSync(path.join(__dirname, 'defs', 'util.json')));
UTIL = Object.assign(UTIL, {

@@ -8,0 +5,0 @@ cmdStatus: COMMON.cmdStatus,

@@ -1,7 +0,4 @@

var fs = require('fs'),
path = require('path'),
COMMON = require('./common');
var COMMON = require('./common'),
ZDO = require('./defs/zdo.json');
var ZDO = JSON.parse(fs.readFileSync(path.join(__dirname, 'defs', 'zdo.json')));
ZDO = Object.assign(ZDO, {

@@ -8,0 +5,0 @@ cmdStatus: COMMON.cmdStatus,

{
"name": "zstack-constants",
"version": "0.0.6",
"description": "Exports constants in TI Z-Stack",
"version": "0.1.0",
"description": "Exports TI Z-Stack Constants of AF, SYS, ZDO, MAC, UTIL, SAPI, and DBG layers.",
"main": "index.js",

@@ -6,0 +6,0 @@ "scripts": {

+10
-15
# zstack-constants
TI Z-Stack Constants of AF, SYS, ZDO, MAC, UTIL, SAPI, and DBG layers.
Exports TI Z-Stack Constants of AF, SYS, ZDO, MAC, UTIL, SAPI, and DBG layers.

@@ -73,3 +73,3 @@ [![Travis branch](https://img.shields.io/travis/zigbeer/zstack-constants/master.svg?maxAge=2592000)](https://travis-ci.org/zigbeer/zstack-constants)

### ZSC.getStatus(code)
### .getStatus(code)
Get the definition of a status code. This method accepts an input code in string or in number, and it will return an object like `{ key: 'BUFFER_FULL', value: 17 }` to tell the status definition. This method will return `undefined` if the given status code is not found.

@@ -120,3 +120,3 @@

* Common Properties
* Common Properties
* config

@@ -158,13 +158,8 @@ ```js

```
* AF Layer Namespace and Properties: [af.json](https://github.com/zigbeer/zstack-constants/blob/master/layer/defs/af.json)
* MAC Layer Namespace and Properties: [mac.json](https://github.com/zigbeer/zstack-constants/blob/master/layer/defs/mac.json)
* SYS Layer Namespace and Properties: [sys.json](https://github.com/zigbeer/zstack-constants/blob/master/layer/defs/sys.json)
* UTIL Layer Namespace and Properties: [util.json](https://github.com/zigbeer/zstack-constants/blob/master/layer/defs/util.json)
* ZDO Layer Namespace and Properties: [zdo.json](https://github.com/zigbeer/zstack-constants/blob/master/layer/defs/zdo.json)
* SAPI Layer Namespace and Properties: [sapi.json](https://github.com/zigbeer/zstack-constants/blob/master/layer/defs/sapi.json)
* DBG Layer Namespace and Properties: [dbg.json](https://github.com/zigbeer/zstack-constants/blob/master/layer/defs/dbg.json)
<br />
* AF Layer Namespace and Properties: [af.json](https://github.com/zigbeer/zstack-constants/blob/master/layer/defs/af.json)
* MAC Layer Namespace and Properties: [mac.json](https://github.com/zigbeer/zstack-constants/blob/master/layer/defs/mac.json)
* SYS Layer Namespace and Properties: [sys.json](https://github.com/zigbeer/zstack-constants/blob/master/layer/defs/sys.json)
* UTIL Layer Namespace and Properties: [util.json](https://github.com/zigbeer/zstack-constants/blob/master/layer/defs/util.json)
* ZDO Layer Namespace and Properties: [zdo.json](https://github.com/zigbeer/zstack-constants/blob/master/layer/defs/zdo.json)
* SAPI Layer Namespace and Properties: [sapi.json](https://github.com/zigbeer/zstack-constants/blob/master/layer/defs/sapi.json)
* DBG Layer Namespace and Properties: [dbg.json](https://github.com/zigbeer/zstack-constants/blob/master/layer/defs/dbg.json)