Skip to content

Commit

Permalink
Adding overwrite flag to has flags, issue dojo#341
Browse files Browse the repository at this point in the history
  • Loading branch information
rorticus committed Jul 28, 2017
1 parent 31ab90b commit e4fb90a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/base64.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import global from '@dojo/shim/global';
import has, { add as hasAdd } from '@dojo/has/has';

hasAdd('btoa', 'btoa' in global);
hasAdd('atob', 'atob' in global);
hasAdd('btoa', 'btoa' in global, true);
hasAdd('atob', 'atob' in global, true);

/**
* Take a string encoded in base64 and decode it
Expand Down
16 changes: 8 additions & 8 deletions src/has.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import has, { add } from '@dojo/shim/support/has';
export * from '@dojo/shim/support/has';
export default has;

add('object-assign', typeof global.Object.assign === 'function');
add('object-assign', typeof global.Object.assign === 'function', true);

add('arraybuffer', typeof global.ArrayBuffer !== 'undefined');
add('formdata', typeof global.FormData !== 'undefined');
add('arraybuffer', typeof global.ArrayBuffer !== 'undefined', true);
add('formdata', typeof global.FormData !== 'undefined', true);
add('filereader', typeof global.FileReader !== 'undefined', true);
add('xhr', typeof global.XMLHttpRequest !== 'undefined');
add('xhr2', has('xhr') && 'responseType' in global.XMLHttpRequest.prototype);
add('xhr', typeof global.XMLHttpRequest !== 'undefined', true);
add('xhr2', has('xhr') && 'responseType' in global.XMLHttpRequest.prototype, true);
add('blob', function () {
if (!has('xhr2')) {
return false;
Expand All @@ -21,8 +21,8 @@ add('blob', function () {
request.responseType = 'blob';
request.abort();
return request.responseType === 'blob';
});
}, true);

add('node-buffer', 'Buffer' in global && typeof global.Buffer === 'function');
add('node-buffer', 'Buffer' in global && typeof global.Buffer === 'function', true);

add('fetch', 'fetch' in global && typeof global.fetch === 'function');
add('fetch', 'fetch' in global && typeof global.fetch === 'function', true);

0 comments on commit e4fb90a

Please sign in to comment.