Comparing version 0.6.17 to 0.6.18
@@ -8,3 +8,3 @@ (function (exportName) { | ||
* zswang (http://weibo.com/zswang) | ||
* @version 0.6.17 | ||
* @version 0.6.18 | ||
* @date 2016-03-21 | ||
@@ -197,2 +197,7 @@ */ | ||
offsets = offsets || [0]; | ||
Object.keys(packSchema.defaultOptions || {}).forEach(function(key) { | ||
if (typeof options[key] === 'undefined') { | ||
options[key] = packSchema.defaultOptions[key]; | ||
} | ||
}); | ||
Object.keys(defaultOptions).forEach(function(key) { | ||
@@ -229,2 +234,7 @@ if (typeof options[key] === 'undefined') { | ||
options = options || {}; | ||
Object.keys(packSchema.defaultOptions || {}).forEach(function(key) { | ||
if (typeof options[key] === 'undefined') { | ||
options[key] = packSchema.defaultOptions[key]; | ||
} | ||
}); | ||
Object.keys(defaultOptions).forEach(function(key) { | ||
@@ -397,3 +407,2 @@ if (typeof options[key] === 'undefined') { | ||
'''</example>''' | ||
* @example map is object | ||
*/ | ||
@@ -593,2 +602,19 @@ var bases = { | ||
``` | ||
* @example arrayCreator():defaultOptions & littleEndian | ||
```js | ||
var _ = jpacks; | ||
var _schema = _.array('int16', 7); | ||
_schema.defaultOptions = { | ||
littleEndian: false | ||
}; | ||
var buffer = _.pack(_schema, [1, 2, 3, 4, 5, 6, 7]); | ||
console.log(buffer.join(' ')); | ||
// > 0 1 0 2 0 3 0 4 0 5 0 6 0 7 | ||
_schema.defaultOptions = { | ||
littleEndian: true | ||
}; | ||
var buffer = _.pack(_schema, [1, 2, 3, 4, 5, 6, 7]); | ||
console.log(buffer.join(' ')); | ||
// > 1 0 2 0 3 0 4 0 5 0 6 0 7 0 | ||
``` | ||
'''</example>''' | ||
@@ -595,0 +621,0 @@ */ |
@@ -8,3 +8,3 @@ (function (exportName) { | ||
* zswang (http://weibo.com/zswang) | ||
* @version 0.6.17 | ||
* @version 0.6.18 | ||
* @date 2016-03-21 | ||
@@ -174,2 +174,7 @@ */ | ||
offsets = offsets || [0]; | ||
Object.keys(packSchema.defaultOptions || {}).forEach(function(key) { | ||
if (typeof options[key] === 'undefined') { | ||
options[key] = packSchema.defaultOptions[key]; | ||
} | ||
}); | ||
Object.keys(defaultOptions).forEach(function(key) { | ||
@@ -198,2 +203,7 @@ if (typeof options[key] === 'undefined') { | ||
options = options || {}; | ||
Object.keys(packSchema.defaultOptions || {}).forEach(function(key) { | ||
if (typeof options[key] === 'undefined') { | ||
options[key] = packSchema.defaultOptions[key]; | ||
} | ||
}); | ||
Object.keys(defaultOptions).forEach(function(key) { | ||
@@ -366,3 +376,2 @@ if (typeof options[key] === 'undefined') { | ||
'''</example>''' | ||
* @example map is object | ||
*/ | ||
@@ -562,2 +571,19 @@ var bases = { | ||
``` | ||
* @example arrayCreator():defaultOptions & littleEndian | ||
```js | ||
var _ = jpacks; | ||
var _schema = _.array('int16', 7); | ||
_schema.defaultOptions = { | ||
littleEndian: false | ||
}; | ||
var buffer = _.pack(_schema, [1, 2, 3, 4, 5, 6, 7]); | ||
console.log(buffer.join(' ')); | ||
// > 0 1 0 2 0 3 0 4 0 5 0 6 0 7 | ||
_schema.defaultOptions = { | ||
littleEndian: true | ||
}; | ||
var buffer = _.pack(_schema, [1, 2, 3, 4, 5, 6, 7]); | ||
console.log(buffer.join(' ')); | ||
// > 1 0 2 0 3 0 4 0 5 0 6 0 7 0 | ||
``` | ||
'''</example>''' | ||
@@ -564,0 +590,0 @@ */ |
@@ -5,3 +5,3 @@ { | ||
"description": "Binary data packing and unpacking.", | ||
"version": "0.6.17", | ||
"version": "0.6.18", | ||
"homepage": "http://github.com/zswang/jpacks", | ||
@@ -8,0 +8,0 @@ "main": "jpacks.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
123097
3975