Passed
Branch v8.x (066794)
by Rafael S.
02:27
created

endianness.umd.js   A

Complexity

Total Complexity 12
Complexity/F 6

Size

Lines of Code 1
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
wmc 12
eloc 1
c 0
b 0
f 0
nc 32
mnd 3
bc 3
fnc 2
dl 0
loc 1
bpm 1.5
cpm 6
noi 3
rs 10
1
/*!
2
 * https://github.com/rochars/endianness
3
 * Copyright (c) 2017-2018 Rafael da Silva Rocha. MIT License.
4
 */
5
function endianness(d,c,a,b){b=void 0===b?d.length:b;if(b%c)throw Error("Bad buffer length.");for(a=void 0===a?0:a;a<b;a+=c)swap(d,c,a)}function swap(d,c,a){c--;for(var b=0;b<c;b++){var e=d[a+b];d[a+b]=d[a+c];d[a+c]=e;c--}};typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = endianness :typeof define === 'function' && define.amd ? define(['exports'], endianness) :typeof global !== 'undefined' ? global.endianness = endianness : null;
6