Skip to content

Commit

Permalink
Update resources
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoalh committed May 4, 2024
1 parent 2a2b559 commit 51c531f
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 117 deletions.
8 changes: 4 additions & 4 deletions .dnt.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { dirname as pathDirname } from "node:path";
import { transform, type TransformOutput } from "DNT/transform";
import { copy as fsCopy } from "STD/fs/copy.ts";
import { emptyDir } from "STD/fs/empty_dir.ts";
import { ensureDir } from "STD/fs/ensure_dir.ts";
import { walk as readDir, type WalkEntry } from "STD/fs/walk.ts";
import { copy as fsCopy } from "STD/fs/copy";
import { emptyDir } from "STD/fs/empty-dir";
import { ensureDir } from "STD/fs/ensure-dir";
import { walk as readDir, type WalkEntry } from "STD/fs/walk";
const pathsMain: WalkEntry[] = await Array.fromAsync(readDir("."));
const transformResult: TransformOutput = await transform({
entryPoints: ["mod.ts"],
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Contributing Guide

This Contributing Guide is depend on ["hxhS (hugoalh & hugoalh Studio) Universal Contributing Guide"](https://github.com/hugoalh/hugoalh/blob/main/universal-guide/contributing.md), along with revise and take precedence over it.
This Contributing Guide is depend on the "[hxhS (hugoalh & hugoalh Studio) Universal Contributing Guide](https://github.com/hugoalh/hugoalh/blob/main/universal-guide/contributing.md)", along with revises and take precedence over it.

## Revise
## Revises

*N/A*
*This project does not have any revise.*
150 changes: 45 additions & 105 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,127 +8,57 @@

An ES (JavaScript & TypeScript) module to determine whether the string is single line.

## 🎯 Target
## 🔰 Begin

- Bun >= v1.1.0
- Cloudflare Workers
- Deno >= v1.42.0
> **🛡️ Require Permission**
>
> *N/A*
- NodeJS >= v16.13.0
### 🎯 Targets

## 🔰 Usage

### Via JSR With `node_modules`

> **🎯 Supported Target**
>
> - Bun
> - Cloudflare Workers
> - NodeJS
1. Install via:
- Bun
```sh
bunx jsr add @hugoalh/is-string-singleline[@${Tag}]
```
- NPM
```sh
npx jsr add @hugoalh/is-string-singleline[@${Tag}]
```
- PNPM
```sh
pnpm dlx jsr add @hugoalh/is-string-singleline[@${Tag}]
```
- Yarn
```sh
yarn dlx jsr add @hugoalh/is-string-singleline[@${Tag}]
```
2. Import at the script:
```ts
import ... from "@hugoalh/is-string-singleline";
```
| | **Registry - JSR** | **Registry - NPM** | **Remote Import** |
|:--|:--|:--|:--|
| **[Bun](https://bun.sh/)** >= v1.1.0 | [✔️ `node_modules`](https://jsr.io/docs/npm-compatibility) | [✔️ Specifier `npm:`](https://bun.sh/docs/runtime/autoimport) ||
| **[Cloudflare Workers](https://workers.cloudflare.com/)** | [✔️ `node_modules`](https://jsr.io/docs/with/cloudflare-workers) | [✔️ `node_modules`](https://docs.npmjs.com/using-npm-packages-in-your-projects) ||
| **[Deno](https://deno.land/)** >= v1.42.0 | [✔️ Specifier `jsr:`](https://jsr.io/docs/with/deno) | [✔️ Specifier `npm:`](https://docs.deno.com/runtime/manual/node/npm_specifiers) | [✔️](https://docs.deno.com/runtime/manual/basics/modules/#remote-import) |
| **[NodeJS](https://nodejs.org/)** >= v16.13.0 | [✔️ `node_modules`](https://jsr.io/docs/with/node) | [✔️ `node_modules`](https://docs.npmjs.com/using-npm-packages-in-your-projects) ||

> **ℹ️ Note**
>
> - Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit [file `jsr.jsonc`](./jsr.jsonc) property `exports` for available sub paths.
> - It is recommended to import the module with tag for immutability.
> It is possible to use this module in other ways which not listed in here, however it is not officially supported.
### Via JSR With Specifier
### #️⃣ Registries Identifier

> **🎯 Supported Target**
>
> - Deno
<table><tbody align="left">
<tr>
<th>JSR</th>
<td width="100%">

1. Import at the script:
```ts
import ... from "jsr:@hugoalh/is-string-singleline[@${Tag}]";
```
```
@hugoalh/is-string-singleline
```

> **ℹ️ Note**
>
> - Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit [file `jsr.jsonc`](./jsr.jsonc) property `exports` for available sub paths.
> - It is recommended to import the module with tag for immutability.
</td>
</tr>
<tr>
<th>NPM</th>
<td width="100%">

### Via NPM With `node_modules`
```
@hugoalh/is-string-singleline
```

> **🎯 Supported Target**
>
> - Cloudflare Workers
> - NodeJS

1. Install via:
- NPM
```sh
npm install @hugoalh/is-string-singleline[@${Tag}]
```
- PNPM
```sh
pnpm add @hugoalh/is-string-singleline[@${Tag}]
```
- Yarn
```sh
yarn add @hugoalh/is-string-singleline[@${Tag}]
```
2. Import at the script:
```ts
import ... from "@hugoalh/is-string-singleline";
```
</td>
</tr>
</tbody></table>

> **ℹ️ Note**
>
> - Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit [file `jsr.jsonc`](./jsr.jsonc) property `exports` for available sub paths.
> - It is recommended to import the module with tag for immutability.

### Via NPM With Specifier

> **🎯 Supported Target**
>
> - Bun
> - Deno
> - It is recommended to use this module with tag for immutability.
1. Import at the script:
```ts
import ... from "npm:@hugoalh/is-string-singleline[@${Tag}]";
```
### #️⃣ Remote Import Paths

> **ℹ️ Note**
>
> - Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit [file `jsr.jsonc`](./jsr.jsonc) property `exports` for available sub paths.
> - It is recommended to import the module with tag for immutability.

### Via Remote Import

> **🎯 Supported Target**
>
> - Deno

1. Import at the script:
```ts
/* Via GitHub Raw (Require Tag) */
import ... from "https://raw.githubusercontent.com/hugoalh-studio/is-string-singleline-es/${Tag}/mod.ts";
```
- Via GitHub Raw (Require Tag)
```
https://raw.githubusercontent.com/hugoalh-studio/is-string-singleline-es/${Tag}/mod.ts
```

> **ℹ️ Note**
>
Expand All @@ -141,6 +71,10 @@ An ES (JavaScript & TypeScript) module to determine whether the string is single
> These elements are not considered part of the public API, thus no stability is guaranteed for them.
> - Although there have 3rd party services which provide enhanced, equal, or similar methods/ways to remote import the module, beware these services maybe inject unrelated elements and thus affect the security.
### 🛡️ Permissions

*This module does not require any permission.*

## 🧩 API

- ```ts
Expand All @@ -157,7 +91,13 @@ An ES (JavaScript & TypeScript) module to determine whether the string is single
## ✍️ Example

- ```ts
isStringSingleLine("Wisi sed et at vero eos nostrud volutpat sed stet dignissim sit sanctus in eros.\nEt laoreet odio sanctus ea.\nSea in dolores diam tincidunt labore sea stet vero dolor ut est.\nAt aliquyam diam facilisis lorem et takimata et volutpat eros erat ipsum velit labore sed ea illum.\nDolor lorem sed et volutpat exerci gubergren gubergren tempor quis ea eirmod eos ut dolor autem ipsum accumsan.");
isStringSingleLine(
`Wisi sed et at vero eos nostrud volutpat sed stet dignissim sit sanctus in eros.
Et laoreet odio sanctus ea.
Sea in dolores diam tincidunt labore sea stet vero dolor ut est.
At aliquyam diam facilisis lorem et takimata et volutpat eros erat ipsum velit labore sed ea illum.
Dolor lorem sed et volutpat exerci gubergren gubergren tempor quis ea eirmod eos ut dolor autem ipsum accumsan.`
);
//=> false
```
- ```ts
Expand Down
6 changes: 3 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
> **ℹ️ Note**
>
> - The date format is according to ISO 8601 standard.
> - The date format is according to the specification ISO 8601.
> - Values in italic format are subject to change.
> - Versions which not in the list are also end of life.
## Report A Vulnerability
## Report Vulnerabilities
You can report a security vulnerability by [create a security vulnerability report](https://github.com/hugoalh/hugoalh/blob/main/universal-guide/contributing.md#create-a-security-vulnerability-report).
You can report security vulnerabilities by [create security vulnerability report](https://github.com/hugoalh/hugoalh/blob/main/universal-guide/contributing.md#create-a-security-vulnerability-report).
3 changes: 2 additions & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
},
"imports": { // IMPORTANT: Remap development dependencies only!
"DNT": "jsr:@deno/[email protected]",
"STD/": "https://deno.land/[email protected]/"
"STD/assert": "jsr:@std/[email protected]",
"STD/fs": "jsr:@std/[email protected]"
},
"lint": {
"rules": {
Expand Down
2 changes: 1 addition & 1 deletion mod.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "STD/assert/assert_equals.ts";
import { assertEquals } from "STD/assert/assert-equals";
import { isStringSingleLine } from "./mod.ts";
const sample1 = `Wisi sed et at vero eos nostrud volutpat sed stet dignissim sit sanctus in eros.
Et laoreet odio sanctus ea.
Expand Down

0 comments on commit 51c531f

Please sign in to comment.