silentium-components 0.0.6 → 0.0.7
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/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/src/strings/Concatenated.test.ts +11 -0
- package/src/strings/Concatenated.ts +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.7](https://github.com/silentium-lab/silentium-components/compare/v0.0.6...v0.0.7) (2025-05-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **main:** concatenated string source component ([77d0bef](https://github.com/silentium-lab/silentium-components/commit/77d0bef86f485e73422a0ede2d72a2fef2d161f5))
|
|
11
|
+
* **main:** release command ([764ee95](https://github.com/silentium-lab/silentium-components/commit/764ee9574526e422d3a73668579914fd83075a4d))
|
|
12
|
+
|
|
5
13
|
### [0.0.6](https://github.com/silentium-lab/silentium-components/compare/v0.0.5...v0.0.6) (2025-05-02)
|
|
6
14
|
|
|
7
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "silentium-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/silentium-components.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"cz": "git add . && git cz",
|
|
21
21
|
"push-head": "git push origin HEAD",
|
|
22
22
|
"test-debug": "env DEBUG=app:* vitest",
|
|
23
|
-
"release": "./beforeRelease.sh && npm run build && git add . && git commit -m 'build: before release' && standard-version --no-verify && git push --follow-tags && npm publish",
|
|
23
|
+
"release": "./beforeRelease.sh && npm run build && git add . && (git commit -m 'build: before release' || echo 'commit failed') && standard-version --no-verify && git push --follow-tags && npm publish",
|
|
24
24
|
"prepare": "husky"
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { sourceSync } from "silentium";
|
|
2
|
+
import { concatenated } from "../strings/Concatenated";
|
|
3
|
+
import { expect, test } from "vitest";
|
|
4
|
+
|
|
5
|
+
test("Concatenated.test", () => {
|
|
6
|
+
const concatenatedSrc = sourceSync(
|
|
7
|
+
concatenated(["one", "two", "three"], "-"),
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
expect(concatenatedSrc.syncValue()).toBe("one-two-three");
|
|
11
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { give, GuestType, sourceCombined, SourceType } from "silentium";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Join sources of strings to one source
|
|
5
|
+
*/
|
|
6
|
+
export const concatenated = (
|
|
7
|
+
sources: SourceType<string>[],
|
|
8
|
+
joinPartSrc: SourceType<string> = "",
|
|
9
|
+
): SourceType<string> => {
|
|
10
|
+
const result = sourceCombined(
|
|
11
|
+
joinPartSrc,
|
|
12
|
+
...sources,
|
|
13
|
+
)((g: GuestType<string>, joinPart, ...strings) => {
|
|
14
|
+
give(strings.join(joinPart), g);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
return result;
|
|
18
|
+
};
|