Initial boiler plate project
This commit is contained in:
208
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/index.js
generated
vendored
Normal file
208
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/index.js
generated
vendored
Normal file
@ -0,0 +1,208 @@
|
||||
import path from "path";
|
||||
import { stringifyRequest } from "../../stringify-request";
|
||||
const loaderApi = ()=>{};
|
||||
loaderApi.pitch = function loader(request) {
|
||||
const loaderSpan = this.currentTraceSpan.traceChild("next-style-loader");
|
||||
return loaderSpan.traceFn(()=>{
|
||||
const options = this.getOptions();
|
||||
const insert = typeof options.insert === "undefined" ? '"head"' : typeof options.insert === "string" ? JSON.stringify(options.insert) : options.insert.toString();
|
||||
const injectType = options.injectType || "styleTag";
|
||||
const esModule = typeof options.esModule !== "undefined" ? options.esModule : false;
|
||||
delete options.esModule;
|
||||
switch(injectType){
|
||||
case "linkTag":
|
||||
{
|
||||
const hmrCode = this.hot ? `
|
||||
if (module.hot) {
|
||||
module.hot.accept(
|
||||
${stringifyRequest(this, `!!${request}`)},
|
||||
function() {
|
||||
${esModule ? "update(content);" : `content = require(${stringifyRequest(this, `!!${request}`)});
|
||||
|
||||
content = content.__esModule ? content.default : content;
|
||||
|
||||
update(content);`}
|
||||
}
|
||||
);
|
||||
|
||||
module.hot.dispose(function() {
|
||||
update();
|
||||
});
|
||||
}` : "";
|
||||
return `${esModule ? `import api from ${stringifyRequest(this, `!${path.join(__dirname, "runtime/injectStylesIntoLinkTag.js")}`)};
|
||||
import content from ${stringifyRequest(this, `!!${request}`)};` : `var api = require(${stringifyRequest(this, `!${path.join(__dirname, "runtime/injectStylesIntoLinkTag.js")}`)});
|
||||
var content = require(${stringifyRequest(this, `!!${request}`)});
|
||||
|
||||
content = content.__esModule ? content.default : content;`}
|
||||
|
||||
var options = ${JSON.stringify(options)};
|
||||
|
||||
options.insert = ${insert};
|
||||
|
||||
var update = api(content, options);
|
||||
|
||||
${hmrCode}
|
||||
|
||||
${esModule ? "export default {}" : ""}`;
|
||||
}
|
||||
case "lazyStyleTag":
|
||||
case "lazySingletonStyleTag":
|
||||
{
|
||||
const isSingleton = injectType === "lazySingletonStyleTag";
|
||||
const hmrCode = this.hot ? `
|
||||
if (module.hot) {
|
||||
if (!content.locals || module.hot.invalidate) {
|
||||
var isEqualLocals = ${require("./runtime/isEqualLocals").toString()};
|
||||
console.log({isEqualLocals})
|
||||
var oldLocals = content.locals;
|
||||
|
||||
module.hot.accept(
|
||||
${stringifyRequest(this, `!!${request}`)},
|
||||
function () {
|
||||
${esModule ? `if (!isEqualLocals(oldLocals, content.locals)) {
|
||||
module.hot.invalidate();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
oldLocals = content.locals;
|
||||
|
||||
if (update && refs > 0) {
|
||||
update(content);
|
||||
}` : `content = require(${stringifyRequest(this, `!!${request}`)});
|
||||
|
||||
content = content.__esModule ? content.default : content;
|
||||
|
||||
if (!isEqualLocals(oldLocals, content.locals)) {
|
||||
module.hot.invalidate();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
oldLocals = content.locals;
|
||||
|
||||
if (update && refs > 0) {
|
||||
update(content);
|
||||
}`}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
module.hot.dispose(function() {
|
||||
if (update) {
|
||||
update();
|
||||
}
|
||||
});
|
||||
}` : "";
|
||||
return `${esModule ? `import api from ${stringifyRequest(this, `!${path.join(__dirname, "runtime/injectStylesIntoStyleTag.js")}`)};
|
||||
import content from ${stringifyRequest(this, `!!${request}`)};` : `var api = require(${stringifyRequest(this, `!${path.join(__dirname, "runtime/injectStylesIntoStyleTag.js")}`)});
|
||||
var content = require(${stringifyRequest(this, `!!${request}`)});
|
||||
|
||||
content = content.__esModule ? content.default : content;
|
||||
|
||||
if (typeof content === 'string') {
|
||||
content = [[module.id, content, '']];
|
||||
}`}
|
||||
|
||||
var refs = 0;
|
||||
var update;
|
||||
var options = ${JSON.stringify(options)};
|
||||
|
||||
options.insert = ${insert};
|
||||
options.singleton = ${isSingleton};
|
||||
|
||||
var exported = {};
|
||||
|
||||
exported.locals = content.locals || {};
|
||||
exported.use = function() {
|
||||
if (!(refs++)) {
|
||||
update = api(content, options);
|
||||
}
|
||||
|
||||
return exported;
|
||||
};
|
||||
exported.unuse = function() {
|
||||
if (refs > 0 && !--refs) {
|
||||
update();
|
||||
update = null;
|
||||
}
|
||||
};
|
||||
|
||||
${hmrCode}
|
||||
|
||||
${esModule ? "export default" : "module.exports ="} exported;`;
|
||||
}
|
||||
case "styleTag":
|
||||
case "singletonStyleTag":
|
||||
default:
|
||||
{
|
||||
const isSingleton = injectType === "singletonStyleTag";
|
||||
const hmrCode = this.hot ? `
|
||||
if (module.hot) {
|
||||
if (!content.locals || module.hot.invalidate) {
|
||||
var isEqualLocals = ${require("./runtime/isEqualLocals").toString()};
|
||||
var oldLocals = content.locals;
|
||||
|
||||
module.hot.accept(
|
||||
${stringifyRequest(this, `!!${request}`)},
|
||||
function () {
|
||||
${esModule ? `if (!isEqualLocals(oldLocals, content.locals)) {
|
||||
module.hot.invalidate();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
oldLocals = content.locals;
|
||||
|
||||
update(content);` : `content = require(${stringifyRequest(this, `!!${request}`)});
|
||||
|
||||
content = content.__esModule ? content.default : content;
|
||||
|
||||
if (typeof content === 'string') {
|
||||
content = [[module.id, content, '']];
|
||||
}
|
||||
|
||||
if (!isEqualLocals(oldLocals, content.locals)) {
|
||||
module.hot.invalidate();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
oldLocals = content.locals;
|
||||
|
||||
update(content);`}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
module.hot.dispose(function() {
|
||||
update();
|
||||
});
|
||||
}` : "";
|
||||
return `${esModule ? `import api from ${stringifyRequest(this, `!${path.join(__dirname, "runtime/injectStylesIntoStyleTag.js")}`)};
|
||||
import content from ${stringifyRequest(this, `!!${request}`)};` : `var api = require(${stringifyRequest(this, `!${path.join(__dirname, "runtime/injectStylesIntoStyleTag.js")}`)});
|
||||
var content = require(${stringifyRequest(this, `!!${request}`)});
|
||||
|
||||
content = content.__esModule ? content.default : content;
|
||||
|
||||
if (typeof content === 'string') {
|
||||
content = [[module.id, content, '']];
|
||||
}`}
|
||||
|
||||
var options = ${JSON.stringify(options)};
|
||||
|
||||
options.insert = ${insert};
|
||||
options.singleton = ${isSingleton};
|
||||
|
||||
var update = api(content, options);
|
||||
|
||||
${hmrCode}
|
||||
|
||||
${esModule ? "export default" : "module.exports ="} content.locals || {};`;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
module.exports = loaderApi;
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/index.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/build/webpack/loaders/next-style-loader/index.ts"],"names":["path","stringifyRequest","loaderApi","pitch","loader","request","loaderSpan","currentTraceSpan","traceChild","traceFn","options","getOptions","insert","JSON","stringify","toString","injectType","esModule","hmrCode","hot","join","__dirname","isSingleton","require","module","exports"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AACvB,SAASC,gBAAgB,QAAQ,0BAAyB;AAE1D,MAAMC,YAAY,KAAO;AAEzBA,UAAUC,KAAK,GAAG,SAASC,OAAkBC,OAAY;IACvD,MAAMC,aAAa,IAAI,CAACC,gBAAgB,CAACC,UAAU,CAAC;IAEpD,OAAOF,WAAWG,OAAO,CAAC;QACxB,MAAMC,UAAU,IAAI,CAACC,UAAU;QAE/B,MAAMC,SACJ,OAAOF,QAAQE,MAAM,KAAK,cACtB,WACA,OAAOF,QAAQE,MAAM,KAAK,WAC1BC,KAAKC,SAAS,CAACJ,QAAQE,MAAM,IAC7BF,QAAQE,MAAM,CAACG,QAAQ;QAC7B,MAAMC,aAAaN,QAAQM,UAAU,IAAI;QACzC,MAAMC,WACJ,OAAOP,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ACNY,WACI,CAAC,gBAAgB,EAAEhB,iBACjB,IAAI,EACJ,CAAC,CAAC,EAAED,KAAKoB,IAAI,CACXC,WACA,uCACA,CAAC,EACH;gCACgB,EAAEpB,iBAAiB,IAAI,EAAE,CAAC,EAAE,EAAEI,QAAQ,CAAC,EAAE,CAAC,CAAC,GAC7D,CAAC,kBAAkB,EAAEJ,iBACnB,IAAI,EACJ,CAAC,CAAC,EAAED,KAAKoB,IAAI,CACXC,WACA,uCACA,CAAC,EACH;kCACkB,EAAEpB,iBAAiB,IAAI,EAAE,CAAC,EAAE,EAAEI,QAAQ,CAAC,EAAE;;;;;;aAM9D,CAAC,CACL;;cAEK,EAAEQ,KAAKC,SAAS,CAACJ,SAAS;;iBAEvB,EAAEE,OAAO;oBACN,EAAEU,YAAY;;;;AAIlC,EAAEJ,QAAQ;;AAEV,EAAED,WAAW,mBAAmB,mBAAmB,sBAAsB,CAAC;gBACpE;QACF;IACF;AACF;AAEAO,OAAOC,OAAO,GAAGvB"}
|
||||
56
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoLinkTag.js
generated
vendored
Normal file
56
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoLinkTag.js
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
const getTarget = (()=>{
|
||||
const memo = {};
|
||||
return function memorize(target) {
|
||||
if (typeof memo[target] === "undefined") {
|
||||
let styleTarget = document.querySelector(target);
|
||||
// Special case to return head of iframe instead of iframe itself
|
||||
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
|
||||
try {
|
||||
// This will throw an exception if access to iframe is blocked
|
||||
// due to cross-origin restrictions
|
||||
styleTarget = styleTarget.contentDocument.head;
|
||||
} catch (e) {
|
||||
// istanbul ignore next
|
||||
styleTarget = null;
|
||||
}
|
||||
}
|
||||
memo[target] = styleTarget;
|
||||
}
|
||||
return memo[target];
|
||||
};
|
||||
})();
|
||||
module.exports = (url, options)=>{
|
||||
options = options || {};
|
||||
options.attributes = typeof options.attributes === "object" ? options.attributes : {};
|
||||
if (typeof options.attributes.nonce === "undefined") {
|
||||
const nonce = // eslint-disable-next-line no-undef
|
||||
typeof __webpack_nonce__ !== "undefined" ? __webpack_nonce__ : null;
|
||||
if (nonce) {
|
||||
options.attributes.nonce = nonce;
|
||||
}
|
||||
}
|
||||
const link = document.createElement("link");
|
||||
link.rel = "stylesheet";
|
||||
link.href = url;
|
||||
Object.keys(options.attributes).forEach((key)=>{
|
||||
link.setAttribute(key, options.attributes[key]);
|
||||
});
|
||||
if (typeof options.insert === "function") {
|
||||
options.insert(link);
|
||||
} else {
|
||||
const target = getTarget(options.insert || "head");
|
||||
if (!target) {
|
||||
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
|
||||
}
|
||||
target.appendChild(link);
|
||||
}
|
||||
return (newUrl)=>{
|
||||
if (typeof newUrl === "string") {
|
||||
link.href = newUrl;
|
||||
} else {
|
||||
link.parentNode.removeChild(link);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
//# sourceMappingURL=injectStylesIntoLinkTag.js.map
|
||||
1
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoLinkTag.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoLinkTag.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../../src/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoLinkTag.ts"],"names":["getTarget","memo","memorize","target","styleTarget","document","querySelector","window","HTMLIFrameElement","contentDocument","head","e","module","exports","url","options","attributes","nonce","__webpack_nonce__","link","createElement","rel","href","Object","keys","forEach","key","setAttribute","insert","Error","appendChild","newUrl","parentNode","removeChild"],"mappings":"AAAA,MAAMA,YAAY,AAAC,CAAA;IACjB,MAAMC,OAAY,CAAC;IAEnB,OAAO,SAASC,SAASC,MAAW;QAClC,IAAI,O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AW,UAAU;YAC9BZ,KAAKG,IAAI,GAAGS;QACd,OAAO;YACLZ,KAAKa,UAAU,CAAEC,WAAW,CAACd;QAC/B;IACF;AACF"}
|
||||
217
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoStyleTag.js
generated
vendored
Normal file
217
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoStyleTag.js
generated
vendored
Normal file
@ -0,0 +1,217 @@
|
||||
const isOldIE = function isOldIE() {
|
||||
let memo;
|
||||
return function memorize() {
|
||||
if (typeof memo === "undefined") {
|
||||
// Test for IE <= 9 as proposed by Browserhacks
|
||||
// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
|
||||
// Tests for existence of standard globals is to allow style-loader
|
||||
// to operate correctly into non-standard environments
|
||||
// @see https://github.com/webpack-contrib/style-loader/issues/177
|
||||
memo = Boolean(window && document && document.all && !window.atob);
|
||||
}
|
||||
return memo;
|
||||
};
|
||||
}();
|
||||
const getTargetElement = function() {
|
||||
const memo = {};
|
||||
return function memorize(target) {
|
||||
if (typeof memo[target] === "undefined") {
|
||||
let styleTarget = document.querySelector(target);
|
||||
// Special case to return head of iframe instead of iframe itself
|
||||
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
|
||||
try {
|
||||
// This will throw an exception if access to iframe is blocked
|
||||
// due to cross-origin restrictions
|
||||
styleTarget = styleTarget.contentDocument.head;
|
||||
} catch (e) {
|
||||
// istanbul ignore next
|
||||
styleTarget = null;
|
||||
}
|
||||
}
|
||||
memo[target] = styleTarget;
|
||||
}
|
||||
return memo[target];
|
||||
};
|
||||
}();
|
||||
const stylesInDom = [];
|
||||
function getIndexByIdentifier(identifier) {
|
||||
let result = -1;
|
||||
for(let i = 0; i < stylesInDom.length; i++){
|
||||
if (stylesInDom[i].identifier === identifier) {
|
||||
result = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function modulesToDom(list, options) {
|
||||
const idCountMap = {};
|
||||
const identifiers = [];
|
||||
for(let i = 0; i < list.length; i++){
|
||||
const item = list[i];
|
||||
const id = options.base ? item[0] + options.base : item[0];
|
||||
const count = idCountMap[id] || 0;
|
||||
const identifier = id + " " + count.toString();
|
||||
idCountMap[id] = count + 1;
|
||||
const index = getIndexByIdentifier(identifier);
|
||||
const obj = {
|
||||
css: item[1],
|
||||
media: item[2],
|
||||
sourceMap: item[3]
|
||||
};
|
||||
if (index !== -1) {
|
||||
stylesInDom[index].references++;
|
||||
stylesInDom[index].updater(obj);
|
||||
} else {
|
||||
stylesInDom.push({
|
||||
identifier: identifier,
|
||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
||||
updater: addStyle(obj, options),
|
||||
references: 1
|
||||
});
|
||||
}
|
||||
identifiers.push(identifier);
|
||||
}
|
||||
return identifiers;
|
||||
}
|
||||
function insertStyleElement(options) {
|
||||
const style = document.createElement("style");
|
||||
const attributes = options.attributes || {};
|
||||
if (typeof attributes.nonce === "undefined") {
|
||||
const nonce = // eslint-disable-next-line no-undef
|
||||
typeof __webpack_nonce__ !== "undefined" ? __webpack_nonce__ : null;
|
||||
if (nonce) {
|
||||
attributes.nonce = nonce;
|
||||
}
|
||||
}
|
||||
Object.keys(attributes).forEach(function(key) {
|
||||
style.setAttribute(key, attributes[key]);
|
||||
});
|
||||
if (typeof options.insert === "function") {
|
||||
options.insert(style);
|
||||
} else {
|
||||
const target = getTargetElement(options.insert || "head");
|
||||
if (!target) {
|
||||
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
|
||||
}
|
||||
target.appendChild(style);
|
||||
}
|
||||
return style;
|
||||
}
|
||||
function removeStyleElement(style) {
|
||||
// istanbul ignore if
|
||||
if (style.parentNode === null) {
|
||||
return false;
|
||||
}
|
||||
style.parentNode.removeChild(style);
|
||||
}
|
||||
/* istanbul ignore next */ const replaceText = function replaceText() {
|
||||
const textStore = [];
|
||||
return function replace(index, replacement) {
|
||||
textStore[index] = replacement;
|
||||
return textStore.filter(Boolean).join("\n");
|
||||
};
|
||||
}();
|
||||
function applyToSingletonTag(style, index, remove, obj) {
|
||||
const css = remove ? "" : obj.media ? "@media " + obj.media + " {" + obj.css + "}" : obj.css;
|
||||
// For old IE
|
||||
/* istanbul ignore if */ if (style.styleSheet) {
|
||||
style.styleSheet.cssText = replaceText(index, css);
|
||||
} else {
|
||||
const cssNode = document.createTextNode(css);
|
||||
const childNodes = style.childNodes;
|
||||
if (childNodes[index]) {
|
||||
style.removeChild(childNodes[index]);
|
||||
}
|
||||
if (childNodes.length) {
|
||||
style.insertBefore(cssNode, childNodes[index]);
|
||||
} else {
|
||||
style.appendChild(cssNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
function applyToTag(style, _options, obj) {
|
||||
let css = obj.css;
|
||||
const media = obj.media;
|
||||
const sourceMap = obj.sourceMap;
|
||||
if (media) {
|
||||
style.setAttribute("media", media);
|
||||
} else {
|
||||
style.removeAttribute("media");
|
||||
}
|
||||
if (sourceMap && typeof btoa !== "undefined") {
|
||||
css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
|
||||
}
|
||||
// For old IE
|
||||
/* istanbul ignore if */ if (style.styleSheet) {
|
||||
style.styleSheet.cssText = css;
|
||||
} else {
|
||||
while(style.firstChild){
|
||||
style.removeChild(style.firstChild);
|
||||
}
|
||||
style.appendChild(document.createTextNode(css));
|
||||
}
|
||||
}
|
||||
let singleton = null;
|
||||
let singletonCounter = 0;
|
||||
function addStyle(obj, options) {
|
||||
let style;
|
||||
let update;
|
||||
let remove;
|
||||
if (options.singleton) {
|
||||
const styleIndex = singletonCounter++;
|
||||
style = singleton || (singleton = insertStyleElement(options));
|
||||
update = applyToSingletonTag.bind(null, style, styleIndex, false);
|
||||
remove = applyToSingletonTag.bind(null, style, styleIndex, true);
|
||||
} else {
|
||||
style = insertStyleElement(options);
|
||||
update = applyToTag.bind(null, style, options);
|
||||
remove = function() {
|
||||
removeStyleElement(style);
|
||||
};
|
||||
}
|
||||
update(obj);
|
||||
return function updateStyle(newObj) {
|
||||
if (newObj) {
|
||||
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
|
||||
return;
|
||||
}
|
||||
update(obj = newObj);
|
||||
} else {
|
||||
remove();
|
||||
}
|
||||
};
|
||||
}
|
||||
module.exports = function(list, options) {
|
||||
options = options || {};
|
||||
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
|
||||
// tags it will allow on a page
|
||||
if (!options.singleton && typeof options.singleton !== "boolean") {
|
||||
options.singleton = isOldIE();
|
||||
}
|
||||
list = list || [];
|
||||
let lastIdentifiers = modulesToDom(list, options);
|
||||
return function update(newList) {
|
||||
newList = newList || [];
|
||||
if (Object.prototype.toString.call(newList) !== "[object Array]") {
|
||||
return;
|
||||
}
|
||||
for(let i = 0; i < lastIdentifiers.length; i++){
|
||||
const identifier = lastIdentifiers[i];
|
||||
const index = getIndexByIdentifier(identifier);
|
||||
stylesInDom[index].references--;
|
||||
}
|
||||
const newLastIdentifiers = modulesToDom(newList, options);
|
||||
for(let i = 0; i < lastIdentifiers.length; i++){
|
||||
const identifier = lastIdentifiers[i];
|
||||
const index = getIndexByIdentifier(identifier);
|
||||
if (stylesInDom[index].references === 0) {
|
||||
stylesInDom[index].updater();
|
||||
stylesInDom.splice(index, 1);
|
||||
}
|
||||
}
|
||||
lastIdentifiers = newLastIdentifiers;
|
||||
};
|
||||
};
|
||||
|
||||
//# sourceMappingURL=injectStylesIntoStyleTag.js.map
|
||||
1
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoStyleTag.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoStyleTag.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
26
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/runtime/isEqualLocals.js
generated
vendored
Normal file
26
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/runtime/isEqualLocals.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
function isEqualLocals(a, b, isNamedExport) {
|
||||
if (!a && b || a && !b) {
|
||||
return false;
|
||||
}
|
||||
let p;
|
||||
for(p in a){
|
||||
if (isNamedExport && p === "default") {
|
||||
continue;
|
||||
}
|
||||
if (a[p] !== b[p]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for(p in b){
|
||||
if (isNamedExport && p === "default") {
|
||||
continue;
|
||||
}
|
||||
if (!a[p]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
module.exports = isEqualLocals;
|
||||
|
||||
//# sourceMappingURL=isEqualLocals.js.map
|
||||
1
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/runtime/isEqualLocals.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/build/webpack/loaders/next-style-loader/runtime/isEqualLocals.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../../src/build/webpack/loaders/next-style-loader/runtime/isEqualLocals.ts"],"names":["isEqualLocals","a","b","isNamedExport","p","module","exports"],"mappings":"AAAA,SAASA,cAAcC,CAAM,EAAEC,CAAM,EAAEC,aAAkB;IACvD,IAAI,AAAC,CAACF,KAAKC,KAAOD,KAAK,CAACC,GAAI;QAC1B,OAAO;IACT;IAEA,IAAIE;IAEJ,IAAKA,KAAKH,EAAG;QACX,IAAIE,iBAAiBC,MAAM,WAAW;YAEpC;QACF;QAEA,IAAIH,CAAC,CAACG,EAAE,KAAKF,CAAC,CAACE,EAAE,EAAE;YACjB,OAAO;QACT;IACF;IAEA,IAAKA,KAAKF,EAAG;QACX,IAAIC,iBAAiBC,MAAM,WAAW;YAEpC;QACF;QAEA,IAAI,CAACH,CAAC,CAACG,EAAE,EAAE;YACT,OAAO;QACT;IACF;IAEA,OAAO;AACT;AAEAC,OAAOC,OAAO,GAAGN"}
|
||||
Reference in New Issue
Block a user