@mornya/cli-libs
Version:
The project of the utilities for CLI.
1 lines • 1.21 kB
JavaScript
;var n=this&&this.__read||function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,i=e.call(r),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a},e=this&&this.__spreadArray||function(r,t,e){if(e||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return r.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.uri2binary=exports.hasProps=exports.removeArrayDups=void 0,exports.removeArrayDups=function removeArrayDups(r,t){if(void 0===t&&(t=[]),r&&Array.isArray(r))return r.length&&t.length?e([],n(r),!1).filter(function(r){return!t.includes(r)}):e([],n(r),!1)},exports.hasProps=function hasProps(r,t,e){return r&&Object.keys(r).length?null!=t?t:r:e},exports.uri2binary=function uri2binary(r){var t,e;return(r=(r=void 0===r?"":r).match(/^data:(.*);(.*),(.*)$/))&&3<r.length?(t=(r=n(r,4))[2],r=r[3],e=Buffer.from(r,t).toString("binary"),new Uint8Array(e.length).map(function(r,t){return e.charCodeAt(t)})):new Uint8Array(0)};