DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
  • Ecosystem
  • Infrastructure
    • can-construct
    • can-control
    • can-event
    • can-event/async/async
    • can-event/batch/batch
    • can-observation
    • can-simple-map
    • can-util
      • can-util/dom
      • can-util/js
        • ./assign/
        • ./base-url/
        • ./cid/
        • ./deep-assign/
        • ./defaults/
        • ./deparam/
        • ./diff/
        • ./diff-object/
        • ./each/
        • ./global/
        • ./import/
        • ./is-array-like/
        • ./is-browser-window/
        • ./is-empty-object/
        • ./is-function
        • ./is-node/
        • ./is-plain-object/
        • ./is-promise/
        • ./is-promise-like/
        • ./is-string/
        • ./is-web-worker/
        • ./join-uris/
        • ./make-array/
        • ./make-promise/
        • ./param/
        • ./set-immediate/
        • ./string/
        • ./string-to-any/
        • ./types/
          • DefaultList
          • DefaultMap
          • isCallableForValue
          • isCompute
          • isConstructor
          • isListLike
          • isMapLike
          • isPromise
          • iterator
          • queueTask
          • unwrapElement
    • can-view-callbacks
    • can-view-live
    • can-view-model
    • can-view-nodelist
    • can-view-parser
    • can-view-scope
    • can-view-target
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Infrastructure
  • /
  • can-util
  • /
  • can-util/js
  • /
  • ./types/
  • / On this page
    • can-util/js/types/types

      module

      A stateful container for CanJS type information.

      • source

      Object

      Use

      can-util/js/types/types exports an object with placeholder functions that can be used to provide default types or test if something is of a certain type.

      This is where the sausage of loose coupling modules takes place. Modules that provide a type will overwrite one or multiple of these functions so they take into account the new type.

      For example, can-define/map/map might overwrite isMapLike to return true if the object is an instance of Map:

      var types = require("can-util/js/types/types");
      var oldIsMapLike = types.isMapLike;
      types.isMapLike = function(obj){
        return obj instanceof DefineMap || oldIsMapLike.apply(this, arguments);
      };
      types.DefaultMap = DefineMap;
      

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.