PageSourceSearch

https://tokyogrown.jp/themes/custom/tokyogrown/assets/common/jquery-compat.js?tm5o7o

js tokyogrown.jp collected 2026-10-01 12:40:14 UTC 1,458 bytes, 46 lines download raw bytes

1/**
2 * jQuery 4.0 compatibility shim.
3 *
4 * 1) Restores $.type() removed in jQuery 4.0 (required by slick.js 1.8).
5 * 2) Re-initialises smooth-scroll with quoted attribute selectors
6 *    (CDN index.js uses [href^=#] which is invalid in jQuery 4.0).
7 *
8 * Must be loaded BEFORE slick.js (for $.type) and
9 * AFTER index.js (for smooth-scroll override, via DOMContentLoaded).
10 */
11(function ($) {
12  /* ── 1. $.type polyfill ── */
13  if (!$.type) {
14    var class2type = {};
15    'Boolean Number String Function Array Date RegExp Object Error Symbol'
16      .split(' ')
17      .forEach(function (name) {
18        class2type['[object ' + name + ']'] = name.toLowerCase();
19      });
20
21    $.type = function (obj) {
22      if (obj == null) {
23        return String(obj);
24      }
25      return typeof obj === 'object' || typeof obj === 'function'
26        ? class2type[Object.prototype.toString.call(obj)] || 'object'
27        : typeof obj;
28    };
29  }
30
31  /* ── 2. Smooth-scroll re-init with valid selectors ── */
32  $(function () {
33    var $target = $('html, body');
34    $('[href^="#"]').not('[href="#"]').not('[data-smooth="false"]').on('click', function () {
35      var hash = this.hash;
36      var data = $(this).data('smooth') || 0;
37      if (hash && $(hash).length) {
38        $target.animate(
39          { scrollTop: $(hash).offset().top + data },
40          { duration: 400, easing: 'linear' }
41        );
42        return false;
43      }
44    });
45  });
46})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.