Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .docs/vitepress/guide/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Getting started

## What's inside?

The library is organized into dedicated extension modules.\
When imported, they safely patch well‑defined methods onto native
prototypes.

Current extension categories include:

- Array
- Date
- Map
- Math
- Number
- Object
- String

Check out the [reference](/reference), to get a deeper understanding of each extension.

## Installation

### Prerequisites

- Node.js version 18 or higher
- A package manager: e.g. npm, pnpm, ...
- A Node.js-based project

Install `@ogs-gmbh/stdx` using your preferred package manager:

::: code-group

```bash [npm]
$ npm add @ogs-gmbh/stdx
```

```bash [pnpm]
$ pnpm install @ogs-gmbh/stdx
```

```bash [yarn]
$ yarn add @ogs-gmbh/stdx
```

```bash [bun]
$ bun add @ogs-gmbh/stdx
```

:::

### Usage

To enable the prototype extensions, simply make sure to import it at top-level:

```typescript [example.ts]
import "@ogs-gmbh/stdx";

// Other code here...
```

That's it!
30 changes: 30 additions & 0 deletions .docs/vitepress/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
layout: home

hero:
text: Standard Library
tagline: Extended functionalities in both JavaScript and TypeScript.
actions:
- theme: brand
text: Get started
link: /guide
- theme: alt
text: Reference
link: /reference
- theme: alt
text: GitHub
link: https://github.com/OGS-GmbH/stdx


features:
- icon: <svg xmlns="http://www.w3.org/2000/svg" height="32px" viewBox="0 -960 960 960" width="48px" fill="#FFFFFF"><path d="M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-60q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Zm0-340Zm-22 220 204-204-42-42-162 162-86-86-42 42 128 128Z"/></svg>
title: Type-Safe
details: Fully typed with strict TypeScript support for compile-time safety.
- icon: <svg xmlns="http://www.w3.org/2000/svg" height="32px" viewBox="0 -960 960 960" width="48px" fill="#FFFFFF"><path d="M440-183v-274L200-596v274l240 139Zm80 0 240-139v-274L520-457v274Zm-80 92L160-252q-19-11-29.5-29T120-321v-318q0-22 10.5-40t29.5-29l280-161q19-11 40-11t40 11l280 161q19 11 29.5 29t10.5 40v318q0 22-10.5 40T800-252L520-91q-19 11-40 11t-40-11Zm200-528 77-44-237-137-78 45 238 136Zm-160 93 78-45-237-137-78 45 237 137Z"/></svg>
title: Modular
details: Tree-shakeable design. Import only what you need, nothing more.
- icon: <svg xmlns="http://www.w3.org/2000/svg" height="32px" viewBox="0 -960 960 960" width="48px" fill="#FFFFFF"><path d="m233-120 65-281L80-590l288-25 112-265 112 265 288 25-218 189 65 281-247-149-247 149Z"/></svg>
title: Zero Dependencies
details: Lightweight and self-contained with no external dependencies.
---

23 changes: 23 additions & 0 deletions .docs/vitepress/legal/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# License

## MIT License

Copyright (c) 2025 OGS Gesellschaft für Datenverarbeitung und Systemberatung mbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 9 additions & 0 deletions .docs/vitepress/other/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Contributing

## Guideline

Contributions are always welcome and greatly appreciated. Whether you want to report a bug, suggest a new feature, or improve the documentation, your input helps make the project better for everyone.

If you're unsure where to start, check the open issues for guidance. Even small contributions, such as fixing typos or improving code readability, are valuable.

Feel free to submit a pull request or start a discussion — we're happy to collaborate!
2 changes: 1 addition & 1 deletion .esbuild/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as esbuild from "esbuild";
import { getConfig } from "./config.mjs";

const preparedConfig = {
outdir: "dist"
outdir: "dist/main"
};

await esbuild.build({
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/docs-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Docs Deploy
on:
workflow_dispatch:

permissions:
id-token: write
contents: write
pull-requests: write
pages: write

jobs:
call-npm-package-docs:
uses: OGS-GmbH/reusable-github-actions/.github/workflows/npm-package-docs.yml@main
secrets:
GH_DEPLOY_TOKEN: ${{ secrets.GH_DEPLOY_TOKEN }}
FONTAWESOME_REGISTRY_AUTH_TOKEN: ${{ secrets.FONTAWESOME_REGISTRY_AUTH_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/main-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ on:
branches:
- "main"
workflow_dispatch:

permissions:
id-token: write
contents: write
pull-requests: write
pages: write

jobs:
call-npm-package-deploy:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/next-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ on:
branches:
- "next"
workflow_dispatch:

permissions:
id-token: write
contents: write
pull-requests: write
pages: write

jobs:
call-npm-package-deploy:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
dist
.vitepress/.vitepress/cache
12 changes: 12 additions & 0 deletions .release-please/next-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/refs/heads/main/schemas/config.json",
"packages": {
".": {
"release-type": "node",
"prerelease": true,
"prerelease-type": "next",
"include-component-in-tag": false,
"always-update": true
}
}
}
1 change: 1 addition & 0 deletions .release-please/next-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{".":"1.1.0"}
75 changes: 75 additions & 0 deletions .vitepress/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { defineConfig } from 'vitepress';
import { groupIconMdPlugin, groupIconVitePlugin } from "vitepress-plugin-group-icons";

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "stdx",
description: "JavaScript/TypeScript Standard library",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
logo: "https://raw.githubusercontent.com/OGS-GmbH/.github/refs/heads/main/docs/logo-white.svg",
nav: [
{ text: "Guide", link: "/guide" },
{ text: "Reference", link: "/reference" },
{ text: "GitHub", link: "https://github.com/OGS-GmbH/stdx" }
],
socialLinks: [
{ icon: "github", link: "https://github.com/OGS-GmbH" },
{ icon: "facebook", link: "https://www.facebook.com/OGS.GmbH" },
{ icon: { svg: '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 382 382" xml:space="preserve"><path d="M347.445,0H34.555C15.471,0,0,15.471,0,34.555v312.889C0,366.529,15.471,382,34.555,382h312.889 C366.529,382,382,366.529,382,347.444V34.555C382,15.471,366.529,0,347.445,0z M118.207,329.844c0,5.554-4.502,10.056-10.056,10.056 H65.345c-5.554,0-10.056-4.502-10.056-10.056V150.403c0-5.554,4.502-10.056,10.056-10.056h42.806 c5.554,0,10.056,4.502,10.056,10.056V329.844z M86.748,123.432c-22.459,0-40.666-18.207-40.666-40.666S64.289,42.1,86.748,42.1 s40.666,18.207,40.666,40.666S109.208,123.432,86.748,123.432z M341.91,330.654c0,5.106-4.14,9.246-9.246,9.246H286.73 c-5.106,0-9.246-4.14-9.246-9.246v-84.168c0-12.556,3.683-55.021-32.813-55.021c-28.309,0-34.051,29.066-35.204,42.11v97.079 c0,5.106-4.139,9.246-9.246,9.246h-44.426c-5.106,0-9.246-4.14-9.246-9.246V149.593c0-5.106,4.14-9.246,9.246-9.246h44.426 c5.106,0,9.246,4.14,9.246,9.246v15.655c10.497-15.753,26.097-27.912,59.312-27.912c73.552,0,73.131,68.716,73.131,106.472 L341.91,330.654L341.91,330.654z"/></svg>' }, link: "https://www.linkedin.com/company/41198063/" },
{ icon: "xing", link: "https://www.xing.com/pages/ogsgmbh" },
{ icon: { svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M480.27-80q-82.74 0-155.5-31.5Q252-143 197.5-197.5t-86-127.34Q80-397.68 80-480.5t31.5-155.66Q143-709 197.5-763t127.34-85.5Q397.68-880 480.5-880t155.66 31.5Q709-817 763-763t85.5 127Q880-563 880-480.27q0 82.74-31.5 155.5Q817-252 763-197.68q-54 54.31-127 86Q563-80 480.27-80Zm-.27-60q142.38 0 241.19-99.5T820-480v-13q-6 26-27.41 43.5Q771.19-432 742-432h-80q-33 0-56.5-23.5T582-512v-40H422v-80q0-33 23.5-56.5T502-712h40v-22q0-16 13.5-40t30.5-29q-25-8-51.36-12.5Q508.29-820 480-820q-141 0-240.5 98.81T140-480h150q66 0 113 47t47 113v40H330v105q34 17 71.7 26t78.3 9Z"/></svg>' }, link: "https://www.ogs.de/en/" },
{ icon: { svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M140-160q-24 0-42-18t-18-42v-520q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H140Zm340-302L140-685v465h680v-465L480-462Zm0-60 336-218H145l335 218ZM140-685v-55 520-465Z"/></svg>' }, link: "mailto:info@ogs.de" }
],
sidebar: [
{
text: "Guide",
items: [
{ text: "Getting started", link: "/guide/" }
]
},
{
text: "Reference",
items: [
{ text: "Overview", link: "/reference/" }
]
},
{
text: "Other",
items: [
{ text: "Contributing", link: "/other/contributing" },
{ text: "Code of Conduct", link: "/other/code-of-conduct" }
]
},
{
text: "Legal",
items: [
{ text: "MIT License", link: "/legal/license" },
{ text: "Copyright © 2025 — present OGS GmbH", link: "https://www.ogs.de/en/" }
]
}
]


},
head: [
[ "link", { rel: "icon", href: "https://www.ogs.de/favicon.ico" } ]
],
base: "/stdx/",
srcDir: "../dist/typedoc",
outDir: "../dist/vitepress",
titleTemplate: ":title - OGS stdx",
cleanUrls: true,
appearance: "dark",
markdown: {
// eslint-disable-next-line @tseslint/typedef
config (md) {
md.use(groupIconMdPlugin);
}
},
vite: {
plugins: [
groupIconVitePlugin()
]
}
});
4 changes: 4 additions & 0 deletions .vitepress/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Theme from 'vitepress/theme'
import 'virtual:group-icons.css'

export default Theme
Loading