@master/eslint-plugin-css 2.0.0-rc.61 → 2.0.0-rc.62

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.
Files changed (52) hide show
  1. package/dist/common.cjs +7 -0
  2. package/dist/common.d.ts +2 -0
  3. package/dist/common.mjs +4 -0
  4. package/dist/create-rule.cjs +1 -1
  5. package/dist/create-rule.mjs +1 -1
  6. package/dist/functions/filter-collision-classes.cjs +1 -1
  7. package/dist/functions/filter-collision-classes.mjs +2 -2
  8. package/dist/rules/class-collision.cjs +44 -38
  9. package/dist/rules/class-collision.mjs +44 -38
  10. package/dist/rules/class-order.cjs +25 -133
  11. package/dist/rules/class-order.mjs +26 -134
  12. package/dist/rules/class-validation.cjs +26 -37
  13. package/dist/rules/class-validation.mjs +26 -37
  14. package/dist/utils/define-visitors.cjs +24 -25
  15. package/dist/utils/define-visitors.d.ts +2 -1
  16. package/dist/utils/define-visitors.mjs +24 -25
  17. package/dist/utils/resolve-class-node.cjs +147 -0
  18. package/dist/utils/resolve-class-node.d.ts +12 -0
  19. package/dist/utils/resolve-class-node.mjs +145 -0
  20. package/dist/utils/resolve-context.cjs +6 -2
  21. package/dist/utils/resolve-context.mjs +6 -2
  22. package/dist/utils/with-visit-class-node.cjs +62 -0
  23. package/dist/utils/with-visit-class-node.d.ts +4 -0
  24. package/dist/utils/with-visit-class-node.mjs +60 -0
  25. package/package.json +1 -1
  26. package/dist/utils/extract-classnames-from-value.cjs +0 -34
  27. package/dist/utils/extract-classnames-from-value.d.ts +0 -6
  28. package/dist/utils/extract-classnames-from-value.mjs +0 -32
  29. package/dist/utils/extract-range-from-node.cjs +0 -18
  30. package/dist/utils/extract-range-from-node.d.ts +0 -1
  31. package/dist/utils/extract-range-from-node.mjs +0 -16
  32. package/dist/utils/extract-value-from-node.cjs +0 -23
  33. package/dist/utils/extract-value-from-node.d.ts +0 -1
  34. package/dist/utils/extract-value-from-node.mjs +0 -21
  35. package/dist/utils/find-loc.cjs +0 -51
  36. package/dist/utils/find-loc.d.ts +0 -7
  37. package/dist/utils/find-loc.mjs +0 -49
  38. package/dist/utils/get-template-element-body.cjs +0 -12
  39. package/dist/utils/get-template-element-body.d.ts +0 -1
  40. package/dist/utils/get-template-element-body.mjs +0 -10
  41. package/dist/utils/get-template-element-prefix.cjs +0 -11
  42. package/dist/utils/get-template-element-prefix.d.ts +0 -1
  43. package/dist/utils/get-template-element-prefix.mjs +0 -9
  44. package/dist/utils/get-template-element-suffix.cjs +0 -10
  45. package/dist/utils/get-template-element-suffix.d.ts +0 -1
  46. package/dist/utils/get-template-element-suffix.mjs +0 -8
  47. package/dist/utils/index-of-all.cjs +0 -12
  48. package/dist/utils/index-of-all.d.ts +0 -1
  49. package/dist/utils/index-of-all.mjs +0 -10
  50. package/dist/utils/parse-node-recursive.cjs +0 -129
  51. package/dist/utils/parse-node-recursive.d.ts +0 -13
  52. package/dist/utils/parse-node-recursive.mjs +0 -127
@@ -15,8 +15,12 @@ function resolveContext(context) {
15
15
  } else {
16
16
  config = exploreConfig({
17
17
  name: resolvedSettings.config,
18
- found: undefined,
19
- cwd: context.cwd
18
+ cwd: context.cwd,
19
+ found (_, configPath) {
20
+ if (process.env.DEBUG) {
21
+ console.log('Found config:', configPath);
22
+ }
23
+ }
20
24
  });
21
25
  }
22
26
  css$1 = new css.MasterCSS(config);
@@ -13,8 +13,12 @@ function resolveContext(context) {
13
13
  } else {
14
14
  config = exploreConfig({
15
15
  name: resolvedSettings.config,
16
- found: undefined,
17
- cwd: context.cwd
16
+ cwd: context.cwd,
17
+ found (_, configPath) {
18
+ if (process.env.DEBUG) {
19
+ console.log('Found config:', configPath);
20
+ }
21
+ }
18
22
  });
19
23
  }
20
24
  css = new MasterCSS(config);
@@ -0,0 +1,62 @@
1
+ 'use strict';
2
+
3
+ var resolveClassNode = require('./resolve-class-node.cjs');
4
+
5
+ function withVisitClassNode(visit, context) {
6
+ const visitNode = (node)=>{
7
+ switch(node.type){
8
+ case 'BinaryExpression':
9
+ case 'Identifier':
10
+ return;
11
+ case 'TemplateLiteral':
12
+ if (node.expressions.length) {
13
+ node.expressions.forEach((exp)=>{
14
+ visitNode(exp);
15
+ });
16
+ }
17
+ node.quasis.forEach((el)=>{
18
+ visitNode(el);
19
+ });
20
+ return;
21
+ case 'JSXExpressionContainer':
22
+ visitNode(node.expression);
23
+ return;
24
+ case 'ConditionalExpression':
25
+ visitNode(node.consequent);
26
+ visitNode(node.alternate);
27
+ return;
28
+ case 'ArrayExpression':
29
+ node.elements.forEach((el)=>{
30
+ visitNode(el);
31
+ });
32
+ return;
33
+ case 'LogicalExpression':
34
+ visitNode(node.right);
35
+ return;
36
+ case 'ObjectExpression':
37
+ node.properties.forEach((prop)=>{
38
+ visitNode(prop);
39
+ });
40
+ return;
41
+ case 'Property':
42
+ if (node.shorthand) return;
43
+ if (node.value && [
44
+ 'Literal',
45
+ 'ArrayExpression',
46
+ 'ObjectExpression'
47
+ ].includes(node.value.type) && typeof node.value?.value !== 'boolean') {
48
+ visitNode(node.value);
49
+ } else if (node.key.type === 'Literal') {
50
+ visitNode(node.key);
51
+ }
52
+ return;
53
+ default:
54
+ let resolved = resolveClassNode(node, context);
55
+ if (!resolved) return;
56
+ visit(node, resolved);
57
+ }
58
+ };
59
+ return visitNode;
60
+ }
61
+
62
+ module.exports = withVisitClassNode;
@@ -0,0 +1,4 @@
1
+ import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
2
+ import resolveClassNode from './resolve-class-node';
3
+ import { TSESTree } from '@typescript-eslint/utils';
4
+ export default function withVisitClassNode(visit: (node: TSESTree.Node, resolved: ReturnType<typeof resolveClassNode>) => void, context: RuleContext<any, any[]>): (node: any) => void;
@@ -0,0 +1,60 @@
1
+ import resolveClassNode from './resolve-class-node.mjs';
2
+
3
+ function withVisitClassNode(visit, context) {
4
+ const visitNode = (node)=>{
5
+ switch(node.type){
6
+ case 'BinaryExpression':
7
+ case 'Identifier':
8
+ return;
9
+ case 'TemplateLiteral':
10
+ if (node.expressions.length) {
11
+ node.expressions.forEach((exp)=>{
12
+ visitNode(exp);
13
+ });
14
+ }
15
+ node.quasis.forEach((el)=>{
16
+ visitNode(el);
17
+ });
18
+ return;
19
+ case 'JSXExpressionContainer':
20
+ visitNode(node.expression);
21
+ return;
22
+ case 'ConditionalExpression':
23
+ visitNode(node.consequent);
24
+ visitNode(node.alternate);
25
+ return;
26
+ case 'ArrayExpression':
27
+ node.elements.forEach((el)=>{
28
+ visitNode(el);
29
+ });
30
+ return;
31
+ case 'LogicalExpression':
32
+ visitNode(node.right);
33
+ return;
34
+ case 'ObjectExpression':
35
+ node.properties.forEach((prop)=>{
36
+ visitNode(prop);
37
+ });
38
+ return;
39
+ case 'Property':
40
+ if (node.shorthand) return;
41
+ if (node.value && [
42
+ 'Literal',
43
+ 'ArrayExpression',
44
+ 'ObjectExpression'
45
+ ].includes(node.value.type) && typeof node.value?.value !== 'boolean') {
46
+ visitNode(node.value);
47
+ } else if (node.key.type === 'Literal') {
48
+ visitNode(node.key);
49
+ }
50
+ return;
51
+ default:
52
+ let resolved = resolveClassNode(node, context);
53
+ if (!resolved) return;
54
+ visit(node, resolved);
55
+ }
56
+ };
57
+ return visitNode;
58
+ }
59
+
60
+ export { withVisitClassNode as default };
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@master/eslint-plugin-css","type":"module","scripts":{"build":"techor build \"src/**/*.{js,ts}\"","dev":"pnpm build --watch","test":"vitest","type-check":"tsc --noEmit","lint":"eslint"},"keywords":["mastercss","eslint","eslintplugin"],"license":"MIT","description":"Master CSS ESLint Plugin","author":"Aoyue Design LLC.","funding":"https://rc.css.master.co/sponsor","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/eslint-plugin"},"sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.mjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./configs/*":{"types":"./dist/configs/*.d.ts","import":"./dist/configs/*.mjs","require":"./dist/configs/*.cjs"}},"files":["dist"],"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/css":"^2.0.0-rc.61","@master/css-explore-config":"^2.0.0-rc.61","@master/css-validator":"^2.0.0-rc.61","@typescript-eslint/utils":"^8.15.0","synckit":"^0.9.2","typescript-eslint":"^8.15.0"},"devDependencies":{"@angular-eslint/template-parser":"^18.4.1","@master/css-explore-config":"^2.0.0-rc.61","@typescript-eslint/rule-tester":"^8.15.0","eslint":"^9.15.0","eslint-plugin-markdown":"^5.1.0","eslint-plugin-mdx":"^3.1.5","shared":"^2.0.0-rc.61","svelte-eslint-parser":"^0.43.0","ts-node":"^10.9.2","vue-eslint-parser":"^9.4.3"},"version":"2.0.0-rc.61"}
1
+ {"name":"@master/eslint-plugin-css","type":"module","scripts":{"build":"techor build \"src/**/*.{js,ts}\"","dev":"pnpm build --watch","test":"vitest","type-check":"tsc --noEmit","lint":"eslint"},"keywords":["mastercss","eslint","eslintplugin"],"license":"MIT","description":"Master CSS ESLint Plugin","author":"Aoyue Design LLC.","funding":"https://rc.css.master.co/sponsor","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/eslint-plugin"},"sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.mjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./configs/*":{"types":"./dist/configs/*.d.ts","import":"./dist/configs/*.mjs","require":"./dist/configs/*.cjs"}},"files":["dist"],"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/css":"^2.0.0-rc.62","@master/css-explore-config":"^2.0.0-rc.62","@master/css-validator":"^2.0.0-rc.62","@typescript-eslint/utils":"^8.29.1","typescript-eslint":"^8.29.1"},"devDependencies":{"@angular-eslint/template-parser":"^19.3.0","@master/css-explore-config":"^2.0.0-rc.62","@typescript-eslint/rule-tester":"^8.29.1","eslint":"^9.24.0","eslint-plugin-markdown":"^5.1.0","eslint-plugin-mdx":"^3.4.0","shared":"^2.0.0-rc.62","svelte-eslint-parser":"^1.1.2","ts-node":"^10.9.2","vue-eslint-parser":"^10.1.3"},"version":"2.0.0-rc.62"}
@@ -1,34 +0,0 @@
1
- 'use strict';
2
-
3
- const separatorRegEx = /([\t\n\f\r ]+)/;
4
- function extractClassnamesFromValue(classStr) {
5
- if (typeof classStr !== 'string') {
6
- return {
7
- classNames: [],
8
- whitespaces: [],
9
- headSpace: false,
10
- tailSpace: false
11
- };
12
- }
13
- const parts = classStr.split(separatorRegEx);
14
- if (parts[0] === '') {
15
- parts.shift();
16
- }
17
- if (parts[parts.length - 1] === '') {
18
- parts.pop();
19
- }
20
- const headSpace = separatorRegEx.test(parts[0]);
21
- const tailSpace = separatorRegEx.test(parts[parts.length - 1]);
22
- const isClass = (_, i)=>headSpace ? i % 2 !== 0 : i % 2 === 0;
23
- const isNotClass = (_, i)=>headSpace ? i % 2 === 0 : i % 2 !== 0;
24
- const classNames = parts.filter(isClass);
25
- const whitespaces = parts.filter(isNotClass);
26
- return {
27
- classNames: classNames,
28
- whitespaces: whitespaces,
29
- headSpace: headSpace,
30
- tailSpace: tailSpace
31
- };
32
- }
33
-
34
- module.exports = extractClassnamesFromValue;
@@ -1,6 +0,0 @@
1
- export default function extractClassnamesFromValue(classStr: any): {
2
- classNames: string[];
3
- whitespaces: string[];
4
- headSpace: boolean;
5
- tailSpace: boolean;
6
- };
@@ -1,32 +0,0 @@
1
- const separatorRegEx = /([\t\n\f\r ]+)/;
2
- function extractClassnamesFromValue(classStr) {
3
- if (typeof classStr !== 'string') {
4
- return {
5
- classNames: [],
6
- whitespaces: [],
7
- headSpace: false,
8
- tailSpace: false
9
- };
10
- }
11
- const parts = classStr.split(separatorRegEx);
12
- if (parts[0] === '') {
13
- parts.shift();
14
- }
15
- if (parts[parts.length - 1] === '') {
16
- parts.pop();
17
- }
18
- const headSpace = separatorRegEx.test(parts[0]);
19
- const tailSpace = separatorRegEx.test(parts[parts.length - 1]);
20
- const isClass = (_, i)=>headSpace ? i % 2 !== 0 : i % 2 === 0;
21
- const isNotClass = (_, i)=>headSpace ? i % 2 === 0 : i % 2 !== 0;
22
- const classNames = parts.filter(isClass);
23
- const whitespaces = parts.filter(isNotClass);
24
- return {
25
- classNames: classNames,
26
- whitespaces: whitespaces,
27
- headSpace: headSpace,
28
- tailSpace: tailSpace
29
- };
30
- }
31
-
32
- export { extractClassnamesFromValue as default };
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- function extractRangeFromNode(node) {
4
- if (node.type === 'TextAttribute' && node.name === 'class') {
5
- return [
6
- node.valueSpan.fullStart.offset,
7
- node.valueSpan.end.offset
8
- ];
9
- }
10
- switch(node.value.type){
11
- case 'JSXExpressionContainer':
12
- return node.value.expression.range;
13
- default:
14
- return node.value.range;
15
- }
16
- }
17
-
18
- module.exports = extractRangeFromNode;
@@ -1 +0,0 @@
1
- export default function extractRangeFromNode(node: any): any;
@@ -1,16 +0,0 @@
1
- function extractRangeFromNode(node) {
2
- if (node.type === 'TextAttribute' && node.name === 'class') {
3
- return [
4
- node.valueSpan.fullStart.offset,
5
- node.valueSpan.end.offset
6
- ];
7
- }
8
- switch(node.value.type){
9
- case 'JSXExpressionContainer':
10
- return node.value.expression.range;
11
- default:
12
- return node.value.range;
13
- }
14
- }
15
-
16
- export { extractRangeFromNode as default };
@@ -1,23 +0,0 @@
1
- 'use strict';
2
-
3
- function extractValueFromNode(node) {
4
- if (node.type === 'TextAttribute' && node.name === 'class') {
5
- return node.value;
6
- }
7
- switch(node.value.type){
8
- case 'JSXExpressionContainer':
9
- return node.value.expression.value;
10
- case 'VExpressionContainer':
11
- switch(node.value.expression.type){
12
- case 'ArrayExpression':
13
- return node.value.expression.elements;
14
- case 'ObjectExpression':
15
- return node.value.expression.properties;
16
- }
17
- return node.value.expression.value;
18
- default:
19
- return node.value.value;
20
- }
21
- }
22
-
23
- module.exports = extractValueFromNode;
@@ -1 +0,0 @@
1
- export default function extractValueFromNode(node: any): any;
@@ -1,21 +0,0 @@
1
- function extractValueFromNode(node) {
2
- if (node.type === 'TextAttribute' && node.name === 'class') {
3
- return node.value;
4
- }
5
- switch(node.value.type){
6
- case 'JSXExpressionContainer':
7
- return node.value.expression.value;
8
- case 'VExpressionContainer':
9
- switch(node.value.expression.type){
10
- case 'ArrayExpression':
11
- return node.value.expression.elements;
12
- case 'ObjectExpression':
13
- return node.value.expression.properties;
14
- }
15
- return node.value.expression.value;
16
- default:
17
- return node.value.value;
18
- }
19
- }
20
-
21
- export { extractValueFromNode as default };
@@ -1,51 +0,0 @@
1
- 'use strict';
2
-
3
- var indexOfAll = require('./index-of-all.cjs');
4
-
5
- function findLoc(text, lines, startLine, startColumn, endLine, endColumn) {
6
- const targetLines = text.match(/.+(?:\r\n|\n)?/g);
7
- let checkingTargetLine = 0;
8
- let resultStart = null;
9
- let checking = false;
10
- for(let i = startLine; i <= endLine; i++){
11
- const sourceCodeLine = lines[i - 1];
12
- const content = targetLines[checkingTargetLine].replace(/\r\n|\n/, '');
13
- const indexes = indexOfAll.indexOfAll(sourceCodeLine, content);
14
- if (indexes.length > 0) {
15
- for (const index of indexes){
16
- if (i === startLine && index < startColumn || i === endLine && index > endColumn) {
17
- continue;
18
- }
19
- if (index !== 0 && sourceCodeLine[index - 1].match(/\w/) || index + content.length < sourceCodeLine.length && sourceCodeLine[index + content.length].match(/\w/)) {
20
- continue;
21
- }
22
- if (checkingTargetLine === 0) {
23
- resultStart = {
24
- line: i,
25
- column: index
26
- };
27
- }
28
- if (checkingTargetLine === targetLines.length - 1) {
29
- return {
30
- start: resultStart,
31
- end: {
32
- line: i,
33
- column: index + text.length
34
- }
35
- };
36
- }
37
- checking = true;
38
- checkingTargetLine++;
39
- }
40
- } else {
41
- if (checking) {
42
- checking = false;
43
- checkingTargetLine = 0;
44
- resultStart = null;
45
- }
46
- }
47
- }
48
- return null;
49
- }
50
-
51
- module.exports = findLoc;
@@ -1,7 +0,0 @@
1
- export default function findLoc(text: any, lines: any, startLine: any, startColumn: any, endLine: any, endColumn: any): {
2
- start: any;
3
- end: {
4
- line: any;
5
- column: any;
6
- };
7
- };
@@ -1,49 +0,0 @@
1
- import { indexOfAll } from './index-of-all.mjs';
2
-
3
- function findLoc(text, lines, startLine, startColumn, endLine, endColumn) {
4
- const targetLines = text.match(/.+(?:\r\n|\n)?/g);
5
- let checkingTargetLine = 0;
6
- let resultStart = null;
7
- let checking = false;
8
- for(let i = startLine; i <= endLine; i++){
9
- const sourceCodeLine = lines[i - 1];
10
- const content = targetLines[checkingTargetLine].replace(/\r\n|\n/, '');
11
- const indexes = indexOfAll(sourceCodeLine, content);
12
- if (indexes.length > 0) {
13
- for (const index of indexes){
14
- if (i === startLine && index < startColumn || i === endLine && index > endColumn) {
15
- continue;
16
- }
17
- if (index !== 0 && sourceCodeLine[index - 1].match(/\w/) || index + content.length < sourceCodeLine.length && sourceCodeLine[index + content.length].match(/\w/)) {
18
- continue;
19
- }
20
- if (checkingTargetLine === 0) {
21
- resultStart = {
22
- line: i,
23
- column: index
24
- };
25
- }
26
- if (checkingTargetLine === targetLines.length - 1) {
27
- return {
28
- start: resultStart,
29
- end: {
30
- line: i,
31
- column: index + text.length
32
- }
33
- };
34
- }
35
- checking = true;
36
- checkingTargetLine++;
37
- }
38
- } else {
39
- if (checking) {
40
- checking = false;
41
- checkingTargetLine = 0;
42
- resultStart = null;
43
- }
44
- }
45
- }
46
- return null;
47
- }
48
-
49
- export { findLoc as default };
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- function getTemplateElementBody(text, prefix, suffix) {
4
- let arr = text.split(prefix);
5
- arr.shift();
6
- const body = arr.join(prefix);
7
- arr = body.split(suffix);
8
- arr.pop();
9
- return arr.join(suffix);
10
- }
11
-
12
- module.exports = getTemplateElementBody;
@@ -1 +0,0 @@
1
- export default function getTemplateElementBody(text: any, prefix: any, suffix: any): any;
@@ -1,10 +0,0 @@
1
- function getTemplateElementBody(text, prefix, suffix) {
2
- let arr = text.split(prefix);
3
- arr.shift();
4
- const body = arr.join(prefix);
5
- arr = body.split(suffix);
6
- arr.pop();
7
- return arr.join(suffix);
8
- }
9
-
10
- export { getTemplateElementBody as default };
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- function getTemplateElementPrefix(text, raw) {
4
- const idx = text.indexOf(raw);
5
- if (idx === 0) {
6
- return '';
7
- }
8
- return text.split(raw).shift();
9
- }
10
-
11
- module.exports = getTemplateElementPrefix;
@@ -1 +0,0 @@
1
- export default function getTemplateElementPrefix(text: any, raw: any): any;
@@ -1,9 +0,0 @@
1
- function getTemplateElementPrefix(text, raw) {
2
- const idx = text.indexOf(raw);
3
- if (idx === 0) {
4
- return '';
5
- }
6
- return text.split(raw).shift();
7
- }
8
-
9
- export { getTemplateElementPrefix as default };
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- function getTemplateElementSuffix(text, raw) {
4
- if (text.indexOf(raw) === -1) {
5
- return '';
6
- }
7
- return text.split(raw).pop();
8
- }
9
-
10
- module.exports = getTemplateElementSuffix;
@@ -1 +0,0 @@
1
- export default function getTemplateElementSuffix(text: any, raw: any): any;
@@ -1,8 +0,0 @@
1
- function getTemplateElementSuffix(text, raw) {
2
- if (text.indexOf(raw) === -1) {
3
- return '';
4
- }
5
- return text.split(raw).pop();
6
- }
7
-
8
- export { getTemplateElementSuffix as default };
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- function indexOfAll(arr, value) {
4
- const result = [];
5
- let i = -1;
6
- while((i = arr.indexOf(value, i + 1)) !== -1){
7
- result.push(i);
8
- }
9
- return result;
10
- }
11
-
12
- exports.indexOfAll = indexOfAll;
@@ -1 +0,0 @@
1
- export declare function indexOfAll(arr: any[] | string, value: any): number[];
@@ -1,10 +0,0 @@
1
- function indexOfAll(arr, value) {
2
- const result = [];
3
- let i = -1;
4
- while((i = arr.indexOf(value, i + 1)) !== -1){
5
- result.push(i);
6
- }
7
- return result;
8
- }
9
-
10
- export { indexOfAll };