Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6e324a3

Browse files
committed
✨ feature(storage+result): add new string storage psi, improve result types
Signed-off-by: Pauline <[email protected]>
1 parent 22ea5be commit 6e324a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+4371
-1285
lines changed

eslint.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ export default defineConfig({
1515
},
1616
}, {
1717
files: ['packages/eslint-plugin/src/rules/**/*.test.ts'],
18-
name: 'user/test/indent',
18+
name: 'userland/test/indent',
1919
rules: { 'petal/indent-unindent': 'error' },
2020
});

package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "module",
55
"version": "4.4.1",
66
"private": true,
7-
"packageManager": "pnpm@9.14.4",
7+
"packageManager": "pnpm@9.15.0",
88
"engineStrict": true,
99
"author": "@flowr",
1010
"contributors": [
@@ -42,13 +42,14 @@
4242
"docs": "turbo run docs --concurrency=4",
4343
"docs:affected": "turbo run docs --filter=...[origin/main] --concurrency=4",
4444
"lint": "eslint --cache . --flag unstable_ts_config",
45-
"format": "pnpm lint --fix",
45+
"lint:fix": "pnpm lint --fix",
4646
"test": "vitest run",
47-
"release": "bumpp -r && turbo run release --concurrency=4",
48-
"create-package": "turbo gen create-package --args"
47+
"test:update": "vitest --update",
48+
"meta:release": "bumpp -r && turbo run release --concurrency=4",
49+
"meta:create": "turbo gen create-package --args"
4950
},
5051
"devDependencies": {
51-
"@arethetypeswrong/cli": "^0.17.0",
52+
"@arethetypeswrong/cli": "^0.17.1",
5253
"@flowr/eslint": "workspace:^",
5354
"@turbo/gen": "^2.3.3",
5455
"@types/jsdom": "^21.1.7",
@@ -64,18 +65,19 @@
6465
"jiti": "^2.4.1",
6566
"jsdom": "^25.0.1",
6667
"jsr": "^0.13.2",
67-
"msw": "^2.6.6",
68+
"msw": "^2.6.8",
6869
"pathe": "^1.1.2",
6970
"tsup": "^8.3.5",
7071
"tsx": "^4.19.2",
7172
"turbo": "^2.3.3",
7273
"typescript": "^5.7.2",
73-
"vite": "^6.0.2",
74+
"vite": "^6.0.3",
7475
"vitest": "^2.1.8"
7576
},
7677
"pnpm": {
7778
"patchedDependencies": {
78-
"@types/jsdom": "./packages/patches/@types__jsdom.patch"
79+
"@types/jsdom": "./packages/patches/@types__jsdom.patch",
80+
"eslint-vitest-rule-tester": "./packages/patches/eslint-vitest-rule-tester.patch"
7981
}
8082
},
8183
"resolutions": {

packages/eslint-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"build": "tsup"
6262
},
6363
"peerDependencies": {
64-
"eslint": "^9.15.0"
64+
"eslint": "^9.16.0"
6565
},
6666
"devDependencies": {
6767
"@flowr/utilities": "workspace:^",

packages/eslint/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"@tanstack/eslint-plugin-query": "^5.52.0",
7070
"@unocss/eslint-plugin": ">=0.60.0 < 1",
7171
"astro-eslint-parser": "^1.0.2",
72-
"eslint": "^9.15.0",
72+
"eslint": "^9.16.0",
7373
"eslint-plugin-astro": "^1.2.3",
7474
"eslint-plugin-format": ">=0.1.0",
7575
"eslint-plugin-json-schema-validator": "^5.1.2",
@@ -177,7 +177,7 @@
177177
"yaml-eslint-parser": "^1.2.3"
178178
},
179179
"devDependencies": {
180-
"@eslint-react/eslint-plugin": "^1.17.3",
180+
"@eslint-react/eslint-plugin": "^1.18.0",
181181
"@eslint/config-inspector": "^0.5.6",
182182
"@flowr/types": "workspace:^",
183183
"@prettier/plugin-xml": "^3.4.1",
@@ -190,9 +190,9 @@
190190
"eslint": "^9.16.0",
191191
"eslint-plugin-astro": "^1.3.1",
192192
"eslint-plugin-format": "^0.1.3",
193-
"eslint-plugin-json-schema-validator": "^5.2.0",
193+
"eslint-plugin-json-schema-validator": "^5.3.1",
194194
"eslint-plugin-jsx-a11y": "^6.10.2",
195-
"eslint-plugin-react-hooks": "^5.0.0",
195+
"eslint-plugin-react-hooks": "^5.1.0",
196196
"eslint-plugin-solid": "^0.14.4",
197197
"eslint-plugin-svelte": "^2.46.1",
198198
"eslint-plugin-vue": "^9.32.0",
@@ -207,7 +207,7 @@
207207
"pathe": "^1.1.2",
208208
"prettier-plugin-astro": "^0.14.1",
209209
"prettier-plugin-slidev": "^1.0.5",
210-
"svelte": "^5.6.2",
210+
"svelte": "^5.8.1",
211211
"svelte-eslint-parser": "^0.43.0",
212212
"vue": "^3.5.13",
213213
"vue-eslint-parser": "^9.4.3"

packages/eslint/tests/fixtures/output/ts-strict/typescript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const dog = new Dog('Buddy');
7777
dog.bark();
7878

7979
function fn(): string {
80-
return `hello${1}`;
80+
return `hello1`;
8181
}
8282

8383
log(car1, car2, favoriteFruit, numericValue, fn());

packages/eslint/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
"tests",
1313
"scripts"
1414
],
15-
"exclude": ["node_modules", "dist", ".turbo"]
15+
"exclude": ["node_modules", "dist", ".turbo", "_fixtures", "fixtures"]
1616
}

packages/iterator/jsr.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"./union": "./src/lib/union.ts",
9393
"./unique": "./src/lib/unique.ts",
9494
"./unzip": "./src/lib/unzip.ts",
95+
"./windows": "./src/lib/windows.ts",
9596
"./zip": "./src/lib/zip.ts"
9697
},
9798
"publish": {

packages/iterator/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"./dist/esm/chunk-ZP5X2XSO.js",
3838
"./dist/esm/chunk-KJ7PVWTC.js",
3939
"./dist/esm/chunk-OHGSFKIM.js",
40+
"./dist/esm/chunk-APKYFUQD.js",
4041
"./dist/esm/chunk-PODDHA2X.js",
4142
"./dist/esm/chunk-SYHLZP64.js",
4243
"./dist/esm/chunk-GP4YLV7L.js",
@@ -1010,6 +1011,16 @@
10101011
"default": "./dist/cjs/lib/unzip.cjs"
10111012
}
10121013
},
1014+
"./windows": {
1015+
"import": {
1016+
"types": "./dist/esm/lib/windows.d.ts",
1017+
"default": "./dist/esm/lib/windows.js"
1018+
},
1019+
"require": {
1020+
"types": "./dist/cjs/lib/windows.d.cts",
1021+
"default": "./dist/cjs/lib/windows.cjs"
1022+
}
1023+
},
10131024
"./zip": {
10141025
"import": {
10151026
"types": "./dist/esm/lib/zip.d.ts",

packages/iterator/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export * from './lib/range.ts';
6666
export * from './lib/reduce.ts';
6767
export * from './lib/repeat.ts';
6868
export * from './lib/reverse.ts';
69-
export type { CompareByComparator, LexicographicComparison } from './lib/shared/_compare.ts';
69+
export type { LexicographicComparison, CompareByComparator } from './lib/shared/_compare.ts';
7070
export type { NumberResolvable } from './lib/shared/_toNumberOrThrow.ts';
7171
export * from './lib/shared/comparators.ts';
7272
export * from './lib/skip.ts';
@@ -87,4 +87,5 @@ export * from './lib/toIterableIterator.ts';
8787
export * from './lib/union.ts';
8888
export * from './lib/unique.ts';
8989
export * from './lib/unzip.ts';
90+
export * from './lib/windows.ts';
9091
export * from './lib/zip.ts';
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { from, type IterableResolvable } from './from.ts';
2+
import { assertPositive } from './shared/_assertPositive.ts';
3+
import { makeIterableIterator } from './shared/_makeIterableIterator.ts';
4+
import { toIntegerOrInfinityOrThrow } from './shared/_toIntegerOrInfinityOrThrow.ts';
5+
6+
/**
7+
* Creates an iterable with arrays of `count` elements representing a sliding window.
8+
*
9+
* @param iterable The iterator to take values from.
10+
* @param count The maximum number of values in the window.
11+
* @returns An iterator that yields windows with `count` values from the provided iterator.
12+
*
13+
* @example
14+
* ```typescript
15+
* import { windows } from '@flowr/iterator';
16+
*
17+
* const iterable = [1, 2, 3, 4, 5];
18+
* console.log([...windows(iterable, 2)]);
19+
* // Output: [[1, 2], [2, 3], [3, 4], [4, 5]]
20+
* ```
21+
*/
22+
export function windows<const ElementType>(iterable: IterableResolvable<ElementType>, count: number): IterableIterator<ElementType[]> {
23+
count = assertPositive(toIntegerOrInfinityOrThrow(count), count);
24+
25+
const buffer = [] as ElementType[];
26+
const resolvedIterable = from(iterable);
27+
return makeIterableIterator<ElementType[]>(() => {
28+
while (buffer.length !== count) {
29+
const result = resolvedIterable.next();
30+
if (result.done)
31+
return { done: true, value: undefined };
32+
33+
buffer.push(result.value);
34+
}
35+
36+
const value = buffer.slice();
37+
buffer.shift();
38+
return { done: false, value };
39+
});
40+
}

0 commit comments

Comments
 (0)