nv-facutil-slct-ta 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/index.js +12 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,3 +1,14 @@
1
+ function check_sz_and_algn(sz,algnsz) {
2
+ if(sz<algnsz) {
3
+ return [false,`size(${sz}) MUST >= algnsz(${algnsz})`]
4
+ } else if(sz % algnsz !== 0) {
5
+ return [false,`size(${sz}) % algnsz(${algnsz}) = ${sz % algnsz} MUST == 0`]
6
+ } else {
7
+ return [true,null]
8
+ }
9
+ }
10
+
11
+
1
12
  function calc_algn_si(si,algnsz) {
2
13
  var r = si % algnsz;
3
14
  if(r === 0) {
@@ -179,6 +190,7 @@ function creat_debug_view(o) {
179
190
 
180
191
 
181
192
  module.exports = {
193
+ check_sz_and_algn,
182
194
  calc_algn_si,
183
195
  calc_max_incr_cnt,
184
196
  get_ta_cls_with_max_cnt,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nv-facutil-slct-ta",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"