UNPKG

niid

Version:
1 lines 1.09 kB
!function(a){"use strict";var b={};!function(a){function b(a,b,e){if(!d(a))throw m;if(!d(b))throw m;Object.keys(b).forEach(c.bind(null,a,b,e))}function c(a,c,f,g){if(!e(a[g],c[g]))throw m;if(d(c[g])){if(f&&f.recurse===!1)return;b(a[g],c[g])}}function d(a){return null!==a&&"object"==typeof a}function e(a,b){return typeof a==typeof b}function f(a){var b,c;return a?(b=Array.prototype.slice.call(a),c=Array.prototype.slice.call(arguments,1),l(a)?g(b,c):h(a,c)):a}function g(a,b){var c,d;c=b.length?b:a,d=c===a?k:j.bind(null,a),c.reduce(d,null)}function h(a,b){var c,d;c=b.length?b:Object.keys(a),d=i.bind(null,a),c.reduce(d,null)}function i(a,b,c){if(void 0===a[c])throw c+" not defined."}function j(a,b,c,d){if("_"!==c&&void 0===a[d])throw c+" not defined."}function k(a,b){if(void 0===b)throw"argument not defined."}function l(a){return"[object Arguments]"===Object.prototype.toString.call(a)}var m="object unlike example.";a.need=f,a.needBeAlike=b}(b),"object"==typeof exports&&module?module.exports=b:"function"==typeof define&&define.amd?define(function(){return b}):a.niid=b}(this);