dependencyLib.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*!
  2. * dependencyLib.js
  3. * http://github.com/RobinHerbots/jquery.inputmask
  4. * Copyright (c) 2010 - 2015 Robin Herbots
  5. * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
  6. * Version: 3.2.1-29
  7. */
  8. !function(factory) {
  9. "function" == typeof define && define.amd ? define([ "jquery" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery")) : factory(jQuery);
  10. }(function($) {
  11. function indexOf(list, elem) {
  12. for (var i = 0, len = list.length; len > i; i++) if (list[i] === elem) return i;
  13. return -1;
  14. }
  15. var dependencyLib = {
  16. isFunction: function(obj) {
  17. return "function" === jQuery.type(obj);
  18. },
  19. noop: function() {},
  20. parseJSON: function(data) {
  21. return JSON.parse(data + "");
  22. },
  23. isArray: Array.isArray,
  24. inArray: function(elem, arr, i) {
  25. return null == arr ? -1 : indexOf.call(arr, elem, i);
  26. },
  27. valHooks: void 0,
  28. extend: $.extend,
  29. each: $.each,
  30. map: $.map,
  31. Event: $.Event,
  32. _data: $._data,
  33. data: $.data
  34. };
  35. return dependencyLib = $, window.dependencyLib = dependencyLib, dependencyLib;
  36. });