File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import React from "react"
2- import PropTypes from "prop-types"
31import Head from "next/head"
2+ import PropTypes from "prop-types"
3+ import React from "react"
4+ import pkg from "../../../package.json"
45import Hero from "./Hero"
56import Tocbot from "./Tocbot"
67import Tracking from "./Tracking"
7- import pkg from "../../../package.json"
88
99function Template ( props ) {
1010 return (
Original file line number Diff line number Diff line change 11/* globals define */
22
33import * as tocbot from "./index-esm.js"
4- ; ( function ( root , factory ) {
4+ ; ( ( root , factory ) => {
55 if ( typeof define === "function" && define . amd ) {
66 define ( [ ] , factory ( root ) )
7- } else if ( typeof exports === "object" ) {
7+ } else if ( typeof exports === "object" && ! ( exports instanceof HTMLElement ) ) {
88 module . exports = factory ( root )
99 } else {
1010 root . tocbot = factory ( root )
1111 }
12- } ) ( typeof global !== "undefined" ? global : window || global , function ( root ) {
13- "use strict"
12+ } ) (
13+ typeof global !== "undefined" && ! ( global instanceof HTMLElement )
14+ ? global
15+ : window || global ,
16+ ( root ) => {
17+ // Just return if its not a browser.
18+ const supports =
19+ ! ! root &&
20+ ! ! root . document &&
21+ ! ! root . document . querySelector &&
22+ ! ! root . addEventListener // Feature test
23+ if ( typeof window === "undefined" && ! supports ) {
24+ return
25+ }
1426
15- // Just return if its not a browser.
16- const supports =
17- ! ! root &&
18- ! ! root . document &&
19- ! ! root . document . querySelector &&
20- ! ! root . addEventListener // Feature test
21- if ( typeof window === "undefined" && ! supports ) {
22- return
23- }
24-
25- // Make tocbot available globally.
26- root . tocbot = tocbot
27+ // Make tocbot available globally.
28+ root . tocbot = tocbot
2729
28- return tocbot
29- } )
30+ return tocbot
31+ } ,
32+ )
You can’t perform that action at this time.
0 commit comments