MCPcopy
hub / github.com/willnewii/qiniuClient / t

Function t

static/dll/cos.js:5–5  ·  view source on GitHub ↗
(e,a)

Source from the content-addressed store, hash-verified

3 * Copyright(c) 2014 dead_horse <dead_horse@qq.com>
4 * MIT Licensed
5 */function a(e,t){return this instanceof a?void(this.src=e,this._withAccess=t):new a(e,t)}function t(e,a){return e[a]===void 0&&e.__lookupGetter__(a)===void 0&&e.__lookupSetter__(a)===void 0}var o=Array.prototype.slice;e.exports=a,a.prototype.withAccess=function(e){return this._withAccess=!1!==e,this},a.prototype.pick=function(e){return Array.isArray(e)||(e=o.call(arguments)),e.length&&(this.keys=e),this},a.prototype.to=function(e){if(e=e||{},!this.src)return e;var a=this.keys||Object.keys(this.src);if(!this._withAccess){for(var o=0;o<a.length;o++)i=a[o],void 0===e[i]&&(e[i]=this.src[i]);return e}for(var o=0,i;o<a.length;o++)if(i=a[o],t(e,i)){var n=this.src.__lookupGetter__(i),s=this.src.__lookupSetter__(i);n&&e.__defineGetter__(i,n),s&&e.__defineSetter__(i,s),n||s||(e[i]=this.src[i])}return e},a.prototype.toCover=function(e){for(var a=this.keys||Object.keys(this.src),t=0,o;t<a.length;t++){o=a[t],delete e[o];var i=this.src.__lookupGetter__(o),n=this.src.__lookupSetter__(o);i&&e.__defineGetter__(o,i),n&&e.__defineSetter__(o,n),i||n||(e[o]=this.src[o])}},a.prototype.override=a.prototype.toCover,a.prototype.and=function(e){var a={};return this.to(a),this.src=e,this.to(a),this.src=a,this}},function(e){e.exports=require('os')},function(e,a,t){function o(e){if(s.string(e),'ssh-dss'===e)return'dsa';if('ssh-rsa'===e)return'rsa';if('ssh-ed25519'===e)return'ed25519';if('ssh-curve25519'===e)return'curve25519';if(e.match(/^ecdsa-sha2-/))return'ecdsa';throw new Error('Unknown algorithm '+e)}function n(e){if(s.object(e),'dsa'===e.type)return'ssh-dss';if('rsa'===e.type)return'ssh-rsa';if('ed25519'===e.type)return'ssh-ed25519';if('curve25519'===e.type)return'ssh-curve25519';if('ecdsa'===e.type)return'ecdsa-sha2-'+e.part.curve.data.toString();throw new Error('Unknown key type '+e.type)}function i(e,a,t){'string'==typeof t&&(t=r.from(t)),s.buffer(t,'buf');var n={},h=n.parts=[],f=new m({buffer:t}),g=f.readString();s.ok(!f.atEnd(),'key must have at least one part'),n.type=o(g);var y=c.info[n.type].parts.length;for(a&&'private'===a&&(y=c.privInfo[n.type].parts.length);!f.atEnd()&&h.length<y;)h.push(f.readPart());for(;!e&&!f.atEnd();)h.push(f.readPart());s.ok(1<=h.length,'key must have at least one part'),s.ok(e||f.atEnd(),'leftover bytes at end of key');var b=d,v=c.info[n.type];if(('private'===a||v.parts.length!==h.length)&&(v=c.privInfo[n.type],b=u),s.strictEqual(v.parts.length,h.length),'ecdsa'===n.type){var x=/^ecdsa-sha2-(.+)$/.exec(g);s.ok(null!==x),s.strictEqual(x[1],h[0].data.toString())}for(var k=!0,w=0,i;w<v.parts.length;++w)if(i=h[w],i.name=v.parts[w],'ed25519'===n.type&&'k'===i.name&&(i.data=i.data.slice(0,32)),'curve'!==i.name&&!1!==v.normalize){var p;p='ed25519'===n.type?l.zeroPadToLength(i.data,32):l.mpNormalize(i.data),p.toString('binary')!==i.data.toString('binary')&&(i.data=p,k=!1)}return k&&(n._rfc4253Cache=f.toBuffer()),e&&'object'==typeof e&&(e.remainder=f.remainder(),e.consumed=f._offset),new b(n)}e.exports={read:i.bind(void 0,!1,void 0),readType:i.bind(void 0,!1),write:function(e){s.object(e);var a=n(e),t=c.info[e.type],o;u.isPrivateKey(e)&&(t=c.privInfo[e.type]);var i=t.parts,p=new m({});for(p.writeString(a),o=0;o<i.length;++o){var d=e.part[i[o]].data;!1!==t.normalize&&('ed25519'===e.type?d=l.zeroPadToLength(d,32):d=l.mpNormalize(d)),'ed25519'===e.type&&'k'===i[o]&&(d=r.concat([d,e.part.A.data])),p.writeBuffer(d)}return p.toBuffer()},readPartial:i.bind(void 0,!0),readInternal:i,keyTypeToAlg:n,algToKeyType:o};var s=t(2),r=t(3).Buffer,c=t(10),l=t(8),d=t(9),u=t(11),m=t(44)},function(e,a,t){e.exports='undefined'!=typeof process&&'renderer'===process.type?t(165):t(166)},function(e){e.exports=require('events')},function(e,a,t){'use strict';function o(e,a,t){var o=t?' !== ':' === ',i=t?' || ':' && ',n=t?'!':'',s=t?'':'!';return'null'===e?a+o+'null':'array'===e?n+'Array.isArray('+a+')':'object'===e?'('+n+a+i+'typeof '+a+o+'"object"'+i+s+'Array.isArray('+a+'))':'integer'===e?'(typeof '+a+o+'"number"'+i+s+'('+a+' % 1)'+i+a+o+a+')':'typeof '+a+o+'"'+e+'"'}function i(e){for(var a={},t=0;t<e.length;t++)a[e[t]]=!0;return a}function n(e){return'number'==typeof e?'['+e+']':u.test(e)?'.'+e:'[\''+s(e)+'\']'}function s(e){return e.replace(m,'\\$&').replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/\f/g,'\\f').replace(/\t/g,'\\t')}function r(e){return'\''+s(e)+'\''}function p(e,a){return'""'==e?a:(e+' + '+a).replace(/' \+ '/g,'')}function c(e){return e.replace(/~/g,'~0').replace(/\//g,'~1')}function l(e){return e.replace(/~1/g,'/').replace(/~0/g,'~')}e.exports={copy:function(e,a){for(var t in a=a||{},e)a[t]=e[t];return a},checkDataType:o,checkDataTypes:function(e,a){switch(e.length){case 1:return o(e[0],a,!0);default:var n='',s=i(e);for(var r in s.array&&s.object&&(n=s.null?'(':'(!'+a+' || ',n+='typeof '+a+' !== "object")',delete s.null,delete s.array,delete s.object),s.number&&delete s.integer,s)n+=(n?' && ':'')+o(r,a,!0);return n;}},coerceToTypes:function(e,a){if(Array.isArray(a)){for(var o=[],n=0,i;n<a.length;n++)i=a[n],d[i]?o[o.length]=i:'array'===e&&'array'===i&&(o[o.length]=i);if(o.length)return o}else{if(d[a])return[a];if('array'===e&&'array'===a)return['array']}},toHash:i,getProperty:n,escapeQuotes:s,equal:t(83),ucs2length:t(299),varOccurences:function(e,a){a+='[^0-9]';var t=e.match(new RegExp(a,'g'));return t?t.length:0},varReplace:function(e,a,t){return a+='([^0-9])',t=t.replace(/\$/g,'$$$$'),e.replace(new RegExp(a,'g'),t+'$1')},cleanUpCode:function(e){return e.replace(h,'').replace(f,'').replace(g,'if (!($1))')},finalCleanUpCode:function(e,a){var t=e.match(y);return t&&2==t.length&&(e=a?e.replace(v,'').replace(w,j):e.replace(b,'').replace(x,k)),t=e.match(S),t&&3===t.length?e.replace(_,''):e},schemaHasRules:function(e,a){if('boolean'==typeof e)return!e;for(var t in e)if(a[t])return!0},schemaHasRulesExcept:function(e,a,t){if('boolean'==typeof e)return!e&&'not'!=t;for(var o in e)if(o!=t&&a[o])return!0},toQuotedString:r,getPathExpr:function(e,a,t,o){var i=t?'\'/\' + '+a+(o?'':'.replace(/~/g, \'~0\').replace(/\\//g, \'~1\')'):o?'\'[\' + '+a+' + \']\'':'\'[\\\'\' + '+a+' + \'\\\']\'';return p(e,i)},getPath:function(e,a,t){var o=t?r('/'+c(a)):r(n(a));return p(e,o)},getData:function(e,a,t){var o,s,r,p;if(''===e)return'rootData';if('/'==e[0]){if(!E.test(e))throw new Error('Invalid JSON-pointer: '+e);s=e,r='rootData'}else{if(p=e.match(C),!p)throw new Error('Invalid JSON-pointer: '+e);if(o=+p[1],s=p[2],'#'==s){if(o>=a)throw new Error('Cannot access property/index '+o+' levels up, current level is '+a);return t[a-o]}if(o>a)throw new Error('Cannot access data '+o+' levels up, current level is '+a);if(r='data'+(a-o||''),!s)return r}for(var c=r,d=s.split('/'),u=0,i;u<d.length;u++)i=d[u],i&&(r+=n(l(i)),c+=' && '+r);return c},unescapeFragment:function(e){return l(decodeURIComponent(e))},unescapeJsonPointer:l,escapeFragment:function(e){return encodeURIComponent(c(e))},escapeJsonPointer:c};var d=i(['string','number','integer','boolean','null']),u=/^[a-z$_][a-z$_0-9]*$/i,m=/'|\\/g,h=/else\s*{\s*}/g,f=/if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g,g=/if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g,y=/[^v.]errors/g,b=/var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g,v=/var errors = 0;|var vErrors = null;/g,x='return errors === 0;',k='validate.errors = null; return true;',w=/if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/,j='return data;',S=/[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g,_=/if \(rootData === undefined\) rootData = data;/,E=/^\/(?:[^~]|~0|~1)*$/,C=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/},function(e,a,t){var o=t(5),i=t(17),n=t(23);a.Mac=function(e,a){this.accessKey=e||i.ACCESS_KEY,this.secretKey=a||i.SECRET_KEY}},function(e,a,t){'use strict';var o=t(91);a.USER_AGENT=o.USER_AGENT,a.TIMEOUT=o.TIMEOUT,a.TIMEOUTS=o.TIMEOUTS,a.agent=o.agent,a.httpsAgent=o.httpsAgent,a.curl=o.curl,a.request=o.request,a.requestWithCallback=o.requestWithCallback,a.requestThunk=o.requestThunk,a.HttpClient=t(101),a.HttpClient2=t(203),a.create=function(e){return new a.HttpClient(e)}},function(e){e.exports=require('net')},function(e,a,t){'use strict';/*!
6 * humanize-ms - index.js
7 * Copyright(c) 2014 dead_horse <dead_horse@qq.com>
8 * MIT Licensed

Callers 15

cos.jsFile · 0.70
sFunction · 0.70
rFunction · 0.70
pFunction · 0.70
eFunction · 0.70
oFunction · 0.70
iFunction · 0.70
CFunction · 0.70
aFunction · 0.70
createSocketMethod · 0.70
uFunction · 0.70
EFunction · 0.70

Calls 15

cFunction · 0.70
aFunction · 0.70
sFunction · 0.70
lFunction · 0.70
nFunction · 0.70
oFunction · 0.70
pFunction · 0.70
rFunction · 0.70
fFunction · 0.70
iFunction · 0.70
hFunction · 0.70
aeFunction · 0.70

Tested by

no test coverage detected