-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06c2f9d
commit 2704161
Showing
2 changed files
with
1,268 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/*can-types@1.1.0#can-types*/ | ||
define([ | ||
'require', | ||
'exports', | ||
'module', | ||
'can-namespace', | ||
'can-reflect', | ||
'can-symbol', | ||
'can-util/js/dev' | ||
], function (require, exports, module) { | ||
var namespace = require('can-namespace'); | ||
var canReflect = require('can-reflect'); | ||
var canSymbol = require('can-symbol'); | ||
var dev = require('can-util/js/dev'); | ||
var types = { | ||
isMapLike: function (obj) { | ||
return canReflect.isObservableLike(obj) && canReflect.isMapLike(obj); | ||
}, | ||
isListLike: function (obj) { | ||
return canReflect.isObservableLike(obj) && canReflect.isListLike(obj); | ||
}, | ||
isPromise: function (obj) { | ||
return canReflect.isPromise(obj); | ||
}, | ||
isConstructor: function (func) { | ||
return canReflect.isConstructorLike(func); | ||
}, | ||
isCallableForValue: function (obj) { | ||
return obj && canReflect.isFunctionLike(obj) && !canReflect.isConstructorLike(obj); | ||
}, | ||
isCompute: function (obj) { | ||
return obj && obj.isComputed; | ||
}, | ||
get iterator() { | ||
return canSymbol.iterator || canSymbol.for('iterator'); | ||
}, | ||
DefaultMap: null, | ||
DefaultList: null, | ||
queueTask: function (task) { | ||
var args = task[2] || []; | ||
task[0].apply(task[1], args); | ||
}, | ||
wrapElement: function (element) { | ||
return element; | ||
}, | ||
unwrapElement: function (element) { | ||
return element; | ||
} | ||
}; | ||
if (namespace.types) { | ||
throw new Error('You can\'t have two versions of can-types, check your dependencies'); | ||
} else { | ||
module.exports = namespace.types = types; | ||
} | ||
}); |
Oops, something went wrong.