Initial commit
This commit is contained in:
7
node_modules/embla-carousel-reactive-utils/cjs/components/utils.d.ts
generated
vendored
Normal file
7
node_modules/embla-carousel-reactive-utils/cjs/components/utils.d.ts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
import { EmblaPluginType } from 'embla-carousel';
|
||||
export declare function isObject(subject: unknown): subject is Record<string, unknown>;
|
||||
export declare function isRecord(subject: unknown): subject is Record<string | number, unknown>;
|
||||
export declare function canUseDOM(): boolean;
|
||||
export declare function areOptionsEqual(optionsA: Record<string, unknown>, optionsB: Record<string, unknown>): boolean;
|
||||
export declare function sortAndMapPluginToOptions(plugins: EmblaPluginType[]): EmblaPluginType['options'][];
|
||||
export declare function arePluginsEqual(pluginsA: EmblaPluginType[], pluginsB: EmblaPluginType[]): boolean;
|
||||
44
node_modules/embla-carousel-reactive-utils/cjs/embla-carousel-reactive-utils.cjs.js
generated
vendored
Normal file
44
node_modules/embla-carousel-reactive-utils/cjs/embla-carousel-reactive-utils.cjs.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
'use strict';
|
||||
|
||||
function isObject(subject) {
|
||||
return Object.prototype.toString.call(subject) === '[object Object]';
|
||||
}
|
||||
function isRecord(subject) {
|
||||
return isObject(subject) || Array.isArray(subject);
|
||||
}
|
||||
function canUseDOM() {
|
||||
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
||||
}
|
||||
function areOptionsEqual(optionsA, optionsB) {
|
||||
const optionsAKeys = Object.keys(optionsA);
|
||||
const optionsBKeys = Object.keys(optionsB);
|
||||
if (optionsAKeys.length !== optionsBKeys.length) return false;
|
||||
const breakpointsA = JSON.stringify(Object.keys(optionsA.breakpoints || {}));
|
||||
const breakpointsB = JSON.stringify(Object.keys(optionsB.breakpoints || {}));
|
||||
if (breakpointsA !== breakpointsB) return false;
|
||||
return optionsAKeys.every(key => {
|
||||
const valueA = optionsA[key];
|
||||
const valueB = optionsB[key];
|
||||
if (typeof valueA === 'function') return `${valueA}` === `${valueB}`;
|
||||
if (!isRecord(valueA) || !isRecord(valueB)) return valueA === valueB;
|
||||
return areOptionsEqual(valueA, valueB);
|
||||
});
|
||||
}
|
||||
function sortAndMapPluginToOptions(plugins) {
|
||||
return plugins.concat().sort((a, b) => a.name > b.name ? 1 : -1).map(plugin => plugin.options);
|
||||
}
|
||||
function arePluginsEqual(pluginsA, pluginsB) {
|
||||
if (pluginsA.length !== pluginsB.length) return false;
|
||||
const optionsA = sortAndMapPluginToOptions(pluginsA);
|
||||
const optionsB = sortAndMapPluginToOptions(pluginsB);
|
||||
return optionsA.every((optionA, index) => {
|
||||
const optionB = optionsB[index];
|
||||
return areOptionsEqual(optionA, optionB);
|
||||
});
|
||||
}
|
||||
|
||||
exports.areOptionsEqual = areOptionsEqual;
|
||||
exports.arePluginsEqual = arePluginsEqual;
|
||||
exports.canUseDOM = canUseDOM;
|
||||
exports.sortAndMapPluginToOptions = sortAndMapPluginToOptions;
|
||||
//# sourceMappingURL=embla-carousel-reactive-utils.cjs.js.map
|
||||
1
node_modules/embla-carousel-reactive-utils/cjs/embla-carousel-reactive-utils.cjs.js.map
generated
vendored
Normal file
1
node_modules/embla-carousel-reactive-utils/cjs/embla-carousel-reactive-utils.cjs.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"embla-carousel-reactive-utils.cjs.js","sources":["../src/components/utils.ts"],"sourcesContent":["import { EmblaPluginType } from 'embla-carousel'\n\nexport function isObject(subject: unknown): subject is Record<string, unknown> {\n return Object.prototype.toString.call(subject) === '[object Object]'\n}\n\nexport function isRecord(\n subject: unknown\n): subject is Record<string | number, unknown> {\n return isObject(subject) || Array.isArray(subject)\n}\n\nexport function canUseDOM(): boolean {\n return !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n )\n}\n\nexport function areOptionsEqual(\n optionsA: Record<string, unknown>,\n optionsB: Record<string, unknown>\n): boolean {\n const optionsAKeys = Object.keys(optionsA)\n const optionsBKeys = Object.keys(optionsB)\n\n if (optionsAKeys.length !== optionsBKeys.length) return false\n\n const breakpointsA = JSON.stringify(Object.keys(optionsA.breakpoints || {}))\n const breakpointsB = JSON.stringify(Object.keys(optionsB.breakpoints || {}))\n\n if (breakpointsA !== breakpointsB) return false\n\n return optionsAKeys.every((key) => {\n const valueA = optionsA[key]\n const valueB = optionsB[key]\n if (typeof valueA === 'function') return `${valueA}` === `${valueB}`\n if (!isRecord(valueA) || !isRecord(valueB)) return valueA === valueB\n return areOptionsEqual(valueA, valueB)\n })\n}\n\nexport function sortAndMapPluginToOptions(\n plugins: EmblaPluginType[]\n): EmblaPluginType['options'][] {\n return plugins\n .concat()\n .sort((a, b) => (a.name > b.name ? 1 : -1))\n .map((plugin) => plugin.options)\n}\n\nexport function arePluginsEqual(\n pluginsA: EmblaPluginType[],\n pluginsB: EmblaPluginType[]\n): boolean {\n if (pluginsA.length !== pluginsB.length) return false\n\n const optionsA = sortAndMapPluginToOptions(pluginsA)\n const optionsB = sortAndMapPluginToOptions(pluginsB)\n\n return optionsA.every((optionA, index) => {\n const optionB = optionsB[index]\n return areOptionsEqual(optionA, optionB)\n })\n}\n"],"names":["isObject","subject","Object","prototype","toString","call","isRecord","Array","isArray","canUseDOM","window","document","createElement","areOptionsEqual","optionsA","optionsB","optionsAKeys","keys","optionsBKeys","length","breakpointsA","JSON","stringify","breakpoints","breakpointsB","every","key","valueA","valueB","sortAndMapPluginToOptions","plugins","concat","sort","a","b","name","map","plugin","options","arePluginsEqual","pluginsA","pluginsB","optionA","index","optionB"],"mappings":";;AAEM,SAAUA,QAAQA,CAACC,OAAgB,EAAA;EACvC,OAAOC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACJ,OAAO,CAAC,KAAK,iBAAiB;AACtE;AAEM,SAAUK,QAAQA,CACtBL,OAAgB,EAAA;EAEhB,OAAOD,QAAQ,CAACC,OAAO,CAAC,IAAIM,KAAK,CAACC,OAAO,CAACP,OAAO,CAAC;AACpD;SAEgBQ,SAASA,GAA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,SAAUC,yBAAyBA,CACvCC,OAA0B,EAAA;AAE1B,EAAA,OAAOA,OAAO,CACXC,MAAM,EAAE,CACRC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAMD,CAAC,CAACE,IAAI,GAAGD,CAAC,CAACC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAE,CAAC,CAC1CC,GAAG,CAAEC,MAAM,IAAKA,MAAM,CAACC,OAAO,CAAC;AACpC;AAEgB,SAAAC,eAAeA,CAC7BC,QAA2B,EAC3BC,QAA2B,EAAA;EAE3B,IAAID,QAAQ,CAACrB,MAAM,KAAKsB,QAAQ,CAACtB,MAAM,EAAE,OAAO,KAAK;AAErD,EAAA,MAAML,QAAQ,GAAGe,yBAAyB,CAACW,QAAQ,CAAC;AACpD,EAAA,MAAMzB,QAAQ,GAAGc,yBAAyB,CAACY,QAAQ,CAAC;EAEpD,OAAO3B,QAAQ,CAACW,KAAK,CAAC,CAACiB,OAAO,EAAEC,KAAK,KAAI;AACvC,IAAA,MAAMC,OAAO,GAAG7B,QAAQ,CAAC4B,KAAK,CAAC;AAC/B,IAAA,OAAO9B,eAAe,CAAC6B,OAAO,EAAEE,OAAO,CAAC;AAC1C,GAAC,CAAC;AACJ;;;;;;;"}
|
||||
1
node_modules/embla-carousel-reactive-utils/cjs/index.d.ts
generated
vendored
Normal file
1
node_modules/embla-carousel-reactive-utils/cjs/index.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export { canUseDOM, areOptionsEqual, sortAndMapPluginToOptions, arePluginsEqual } from './components/utils';
|
||||
55
node_modules/embla-carousel-reactive-utils/cjs/package.json
generated
vendored
Normal file
55
node_modules/embla-carousel-reactive-utils/cjs/package.json
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "embla-carousel-reactive-utils",
|
||||
"version": "8.3.1",
|
||||
"author": "David Jerleke",
|
||||
"description": "Reactive utilities for Embla Carousel",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/davidjerleke/embla-carousel"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/davidjerleke/embla-carousel/issues"
|
||||
},
|
||||
"homepage": "https://www.embla-carousel.com",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"slider",
|
||||
"carousel",
|
||||
"slideshow",
|
||||
"gallery",
|
||||
"lightweight",
|
||||
"touch",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"react",
|
||||
"vue",
|
||||
"svelte",
|
||||
"solid"
|
||||
],
|
||||
"types": "index.d.ts",
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"embla-carousel-reactive-utils*",
|
||||
"components/**/*",
|
||||
"index.d.ts"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.6",
|
||||
"@typescript-eslint/eslint-plugin": "^6.9.0",
|
||||
"@typescript-eslint/parser": "^6.9.0",
|
||||
"eslint": "^8.52.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"jest": "^29.5.0",
|
||||
"jest-environment-jsdom": "^29.5.0",
|
||||
"prettier": "2.8.8",
|
||||
"rollup": "^4.22.4",
|
||||
"ts-jest": "^29.1.1",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"embla-carousel": "8.3.1"
|
||||
},
|
||||
"main": "embla-carousel-reactive-utils.cjs.js",
|
||||
"type": "commonjs"
|
||||
}
|
||||
Reference in New Issue
Block a user