@nyaomaru/divider 1.9.5 → 1.9.6
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/README.md +41 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
<a href="https://www.npmjs.com/package/@nyaomaru/divider">
|
|
9
9
|
<img src="https://img.shields.io/npm/v/@nyaomaru/divider.svg?sanitize=true" alt="npm version">
|
|
10
10
|
</a>
|
|
11
|
+
<a href="https://jsr.io/@nyaomaru/divider">
|
|
12
|
+
<img src="https://img.shields.io/badge/JSR-@nyaomaru/divider-blue" alt="JSR">
|
|
13
|
+
</a>
|
|
11
14
|
<a href="https://github.com/nyaomaru/divider/blob/main/LICENSE">
|
|
12
15
|
<img src="https://img.shields.io/npm/l/@nyaomaru/divider.svg?sanitize=true" alt="License">
|
|
13
16
|
</a>
|
|
@@ -39,6 +42,32 @@ bun add @nyaomaru/divider
|
|
|
39
42
|
yarn add @nyaomaru/divider
|
|
40
43
|
```
|
|
41
44
|
|
|
45
|
+
### Deno / Bun (via JSR)
|
|
46
|
+
|
|
47
|
+
This package is also published on JSR and works in Deno and Bun without a bundler.
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
// Deno/Bun: import directly from JSR
|
|
51
|
+
import { divider } from 'jsr:@nyaomaru/divider';
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Version pinning examples:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
// Pin a major version (recommended)
|
|
58
|
+
import { divider } from 'jsr:@nyaomaru/divider@^1';
|
|
59
|
+
|
|
60
|
+
// Or pin an exact version
|
|
61
|
+
import { divider } from 'jsr:@nyaomaru/divider@1.9.4';
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
For Bun, you can also add it to your project manifest:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
# Pin a major version in Bun
|
|
68
|
+
bun add jsr:@nyaomaru/divider@^1
|
|
69
|
+
```
|
|
70
|
+
|
|
42
71
|
## 📖 Documentation
|
|
43
72
|
|
|
44
73
|
- 📝 Guide: [https://divider-docs.vercel.app](https://divider-docs.vercel.app)
|
|
@@ -271,3 +300,15 @@ Thank you for your contribution. 😺
|
|
|
271
300
|
- [DEVELOPER.md](./DEVELOPER.md) — Development setup and contributor guide
|
|
272
301
|
- [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) — Community standards and conduct
|
|
273
302
|
- [CHANGELOG.md](./CHANGELOG.md) — Version history and notable changes
|
|
303
|
+
|
|
304
|
+
## 🟦 Deno / JSR Notes
|
|
305
|
+
|
|
306
|
+
- Import path alias `@/` is supported in Deno via the included `deno.json` import map.
|
|
307
|
+
- Type-check locally with Deno: `deno task check` (or `deno check ./src/index.ts`).
|
|
308
|
+
- Publish to JSR from a tagged commit: `deno publish`.
|
|
309
|
+
- CI: On PRs, we run `deno fmt --check` / `deno lint` / `deno check` / `deno test`.
|
|
310
|
+
- CI JSR publish runs `deno publish` when a GitHub Release is published (OIDC-based; no personal token required).
|
|
311
|
+
- `deno test` is configured to only target `tests-deno/**` (Bun/Jest tests are excluded).
|
|
312
|
+
- For local development, Deno's `unstable` `sloppy-imports` is enabled to resolve the `@/` alias (this does not affect JSR publishing or consumers).
|
|
313
|
+
- VSCode: to enable Bun type completions, add `bun-types` as a dev dependency and include `"bun-types"` in `tests-bun/tsconfig.json` `types` (this repo is preconfigured).
|
|
314
|
+
- VSCode: the Deno extension is enabled only for `tests-deno/` (see `.vscode/settings.json`), which fixes typings for `jsr:@std/assert`.
|
package/dist/index.d.cts
CHANGED
|
@@ -75,7 +75,7 @@ declare function dividerFirst(input: DividerInput, ...args: DividerSeparators):
|
|
|
75
75
|
* @returns The last segment after division, or an empty string if no segments are found
|
|
76
76
|
* @example
|
|
77
77
|
* dividerLast("hello-world", "-") // returns "world"
|
|
78
|
-
* dividerLast("abc123def", 3) // returns "def"
|
|
78
|
+
* dividerLast("abc123def", "3") // returns "def"
|
|
79
79
|
*/
|
|
80
80
|
declare function dividerLast(input: DividerInput, ...args: DividerSeparators): string;
|
|
81
81
|
|
package/dist/index.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ declare function dividerFirst(input: DividerInput, ...args: DividerSeparators):
|
|
|
75
75
|
* @returns The last segment after division, or an empty string if no segments are found
|
|
76
76
|
* @example
|
|
77
77
|
* dividerLast("hello-world", "-") // returns "world"
|
|
78
|
-
* dividerLast("abc123def", 3) // returns "def"
|
|
78
|
+
* dividerLast("abc123def", "3") // returns "def"
|
|
79
79
|
*/
|
|
80
80
|
declare function dividerLast(input: DividerInput, ...args: DividerSeparators): string;
|
|
81
81
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nyaomaru/divider",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.9.
|
|
4
|
+
"version": "1.9.6",
|
|
5
5
|
"description": "To divide string or string[] with a given separator",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"@eslint/js": "^9.26.0",
|
|
39
39
|
"@types/jest": "^30.0.0",
|
|
40
40
|
"@types/node": "^22.15.12",
|
|
41
|
+
"bun-types": "^1.2.21",
|
|
41
42
|
"eslint": "^9.26.0",
|
|
42
43
|
"eslint-config-prettier": "^10.1.2",
|
|
43
44
|
"eslint-plugin-prettier": "^5.4.0",
|