@icebreakers/stylelint-config 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +74 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +75 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -23,7 +23,77 @@ __export(src_exports, {
|
|
|
23
23
|
icebreaker: () => icebreaker
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(src_exports);
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
28
|
+
function isPlainObject(value) {
|
|
29
|
+
if (value === null || typeof value !== "object") {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
const prototype = Object.getPrototypeOf(value);
|
|
33
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
if (Symbol.iterator in value) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
if (Symbol.toStringTag in value) {
|
|
40
|
+
return Object.prototype.toString.call(value) === "[object Module]";
|
|
41
|
+
}
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
45
|
+
if (!isPlainObject(defaults)) {
|
|
46
|
+
return _defu(baseObject, {}, namespace, merger);
|
|
47
|
+
}
|
|
48
|
+
const object = Object.assign({}, defaults);
|
|
49
|
+
for (const key in baseObject) {
|
|
50
|
+
if (key === "__proto__" || key === "constructor") {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const value = baseObject[key];
|
|
54
|
+
if (value === null || value === void 0) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (merger && merger(object, key, value, namespace)) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
61
|
+
object[key] = [...value, ...object[key]];
|
|
62
|
+
} else if (isPlainObject(value) && isPlainObject(object[key])) {
|
|
63
|
+
object[key] = _defu(
|
|
64
|
+
value,
|
|
65
|
+
object[key],
|
|
66
|
+
(namespace ? `${namespace}.` : "") + key.toString(),
|
|
67
|
+
merger
|
|
68
|
+
);
|
|
69
|
+
} else {
|
|
70
|
+
object[key] = value;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return object;
|
|
74
|
+
}
|
|
75
|
+
function createDefu(merger) {
|
|
76
|
+
return (...arguments_) => (
|
|
77
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
78
|
+
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
var defu = createDefu();
|
|
82
|
+
var defuFn = createDefu((object, key, currentValue) => {
|
|
83
|
+
if (object[key] !== void 0 && typeof currentValue === "function") {
|
|
84
|
+
object[key] = currentValue(object[key]);
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
var defuArrayFn = createDefu((object, key, currentValue) => {
|
|
89
|
+
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
90
|
+
object[key] = currentValue(object[key]);
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// src/index.ts
|
|
96
|
+
function createDefaultConfig() {
|
|
27
97
|
return {
|
|
28
98
|
extends: [
|
|
29
99
|
// extends: ['stylelint-config-standard', 'stylelint-config-recommended-scss']
|
|
@@ -43,6 +113,9 @@ function icebreaker() {
|
|
|
43
113
|
]
|
|
44
114
|
};
|
|
45
115
|
}
|
|
116
|
+
function icebreaker(config) {
|
|
117
|
+
return defu(config, createDefaultConfig());
|
|
118
|
+
}
|
|
46
119
|
// Annotate the CommonJS export names for ESM import in node:
|
|
47
120
|
0 && (module.exports = {
|
|
48
121
|
icebreaker
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -4,7 +4,78 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// src/index.ts
|
|
6
6
|
init_esm_shims();
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
9
|
+
init_esm_shims();
|
|
10
|
+
function isPlainObject(value) {
|
|
11
|
+
if (value === null || typeof value !== "object") {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
const prototype = Object.getPrototypeOf(value);
|
|
15
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
if (Symbol.iterator in value) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (Symbol.toStringTag in value) {
|
|
22
|
+
return Object.prototype.toString.call(value) === "[object Module]";
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
27
|
+
if (!isPlainObject(defaults)) {
|
|
28
|
+
return _defu(baseObject, {}, namespace, merger);
|
|
29
|
+
}
|
|
30
|
+
const object = Object.assign({}, defaults);
|
|
31
|
+
for (const key in baseObject) {
|
|
32
|
+
if (key === "__proto__" || key === "constructor") {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const value = baseObject[key];
|
|
36
|
+
if (value === null || value === void 0) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (merger && merger(object, key, value, namespace)) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
43
|
+
object[key] = [...value, ...object[key]];
|
|
44
|
+
} else if (isPlainObject(value) && isPlainObject(object[key])) {
|
|
45
|
+
object[key] = _defu(
|
|
46
|
+
value,
|
|
47
|
+
object[key],
|
|
48
|
+
(namespace ? `${namespace}.` : "") + key.toString(),
|
|
49
|
+
merger
|
|
50
|
+
);
|
|
51
|
+
} else {
|
|
52
|
+
object[key] = value;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return object;
|
|
56
|
+
}
|
|
57
|
+
function createDefu(merger) {
|
|
58
|
+
return (...arguments_) => (
|
|
59
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
60
|
+
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
var defu = createDefu();
|
|
64
|
+
var defuFn = createDefu((object, key, currentValue) => {
|
|
65
|
+
if (object[key] !== void 0 && typeof currentValue === "function") {
|
|
66
|
+
object[key] = currentValue(object[key]);
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
var defuArrayFn = createDefu((object, key, currentValue) => {
|
|
71
|
+
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
72
|
+
object[key] = currentValue(object[key]);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// src/index.ts
|
|
78
|
+
function createDefaultConfig() {
|
|
8
79
|
return {
|
|
9
80
|
extends: [
|
|
10
81
|
// extends: ['stylelint-config-standard', 'stylelint-config-recommended-scss']
|
|
@@ -24,6 +95,9 @@ function icebreaker() {
|
|
|
24
95
|
]
|
|
25
96
|
};
|
|
26
97
|
}
|
|
98
|
+
function icebreaker(config) {
|
|
99
|
+
return defu(config, createDefaultConfig());
|
|
100
|
+
}
|
|
27
101
|
export {
|
|
28
102
|
icebreaker
|
|
29
103
|
};
|