Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Adding overwrite flag to has flags #349

Merged
merged 1 commit into from
Jul 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);