repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/components/subreddit-page/Header.tsx
components/subreddit-page/Header.tsx
import React, { useState } from "react"; import { postSubscribe } from "../../functions/service"; const Header = ({ subreddit, user_is_subscriber, name, token }: any) => { const [following, setFollowing] = useState(user_is_subscriber); const castFollow = (action: string) => { if (token != "") { postSubsc...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/components/home-page/MidCard.tsx
components/home-page/MidCard.tsx
import React from "react"; import { getIntFromString, limitText } from "../../functions/common"; import { PLACEHOLDER_IMAGES, TITLE_MAX } from "../../functions/constants"; import { Post } from "../../interfaces"; import { PostMetadata } from "../common"; const MidCard = ({ title, created_utc, subreddit_name_pref...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/components/home-page/TrendingSubs.tsx
components/home-page/TrendingSubs.tsx
import React from "react"; const TrendingSubs = (trendingSubs: any) => ( <div className="mb-6"> <div className="mb-5"> <p className="heading-text text-sm leading-4 uppercase tracking-wide sm:text-xs"> Trending subreddits </p> </div> <div> {trendingSubs.hasOwnProperty("posts") ? ...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/components/home-page/RankedCard.tsx
components/home-page/RankedCard.tsx
import React from "react"; import { getIntFromString } from "../../functions/common"; import { PostMetadata } from "../common"; const RankedCard = ({ title, created_utc, subreddit_name_prefixed, author, rank, permalink }: any) => title ? ( <div className="mid-container"> <div className="mr-4 pb...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/components/home-page/WideCard.tsx
components/home-page/WideCard.tsx
import React from "react"; import { getIntFromString, limitText } from "../../functions/common"; import { PLACEHOLDER_IMAGES, TITLE_MAX } from "../../functions/constants"; import { Post } from "../../interfaces"; import { PostMetadata } from "../common"; const WideCard = ({ title, created_utc, subreddit_name_pre...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/components/home-page/LargeCard.tsx
components/home-page/LargeCard.tsx
import React from "react"; import { getIntFromString, limitText } from "../../functions/common"; import { PLACEHOLDER_IMAGES, TITLE_MAX } from "../../functions/constants"; import { Post } from "../../interfaces"; import { PostMetadata } from "../common"; const LargeCard = (post: Post) => post.hasOwnProperty("title")...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/components/post-page/PostComments.tsx
components/post-page/PostComments.tsx
import React from "react"; import { Comment } from "./Comment"; const PostComments = ({ comments, backToPost, token }: any) => { return ( <div className="w-full mx-auto max-w-600 pb-2 mt-6 sm:mx-6 sm:w-auto post-content"> <div className="my-2 mx-4 px-6 py-3 input-shadow rounded"> <h4 className="sub...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/components/post-page/PostHeader.tsx
components/post-page/PostHeader.tsx
import React from "react"; const PostHeader = ({ subreddit }: any) => ( <header className="w-full blue-bg text-white"> <div className="flex px-4 max-width-main mx-auto flex-row items-center lg:w-auto lg:mx-12 sm:mx-6 sm:px-0"> <div> <a href={`/r/${subreddit}`}> <h1 className="tracking-wid...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/components/post-page/Comment.tsx
components/post-page/Comment.tsx
import Link from "next/link"; import React, { useState } from "react"; import MarkdownView from "react-showdown"; import { findRegularNested, getIntFromString, getTime, hasMoreComments } from "../../functions/common"; import { upvote } from "../../functions/service"; export const RootComment = ({ comment, de...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/components/post-page/PostContent.tsx
components/post-page/PostContent.tsx
import Link from "next/link"; import React, { useState } from "react"; import MarkdownView from "react-showdown"; import { getEmbedLink, getIntFromString, getTime, isImage, isVideo, limitText, replaceGifv, unsplashCredits } from "../../functions/common"; import { PLACEHOLDER_IMAGES, TITLE_MAX } from ".....
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/components/common/index.tsx
components/common/index.tsx
import { zipObject } from "lodash"; import React, { useEffect, useRef, useState } from "react"; import { getIntFromString, getTime, limitText } from "../../functions/common"; import { CLIENT_ID, DESC_MAX, REDIRECT_URI } from "../../functions/constants"; import { DropdownProps, Props } from "../../interfaces"; export c...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/components/user-page/UserComment.tsx
components/user-page/UserComment.tsx
import React from "react"; import MarkdownView from "react-showdown"; import { getTime } from "../../functions/common"; const UserComment = ({ body, created_utc, replies, ups, link_title, permalink, subreddit_name_prefixed }: any) => { return replies || replies == "" ? ( <div className="w-full mx-...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/components/user-page/UserPost.tsx
components/user-page/UserPost.tsx
import React from "react"; import MarkdownView from "react-showdown"; import { getIntFromString, getTime, limitText, replaceGifv, unsplashCredits, } from "../../functions/common"; import { BLURB_MAX, PLACEHOLDER_IMAGES, TITLE_MAX, } from "../../functions/constants"; import { Post } from "../../interface...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/components/search-page/SearchPost.tsx
components/search-page/SearchPost.tsx
import Link from "next/link"; import React, { useState } from "react"; import MarkdownView from "react-showdown"; import { getIntFromString, getTime, limitText, replaceGifv } from "../../functions/common"; import { DESC_MAX, PLACEHOLDER_IMAGES, TITLE_MAX } from "../../functions/constants"; import { Post }...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/utils/sample-data.ts
utils/sample-data.ts
import { User } from '../interfaces' /** Dummy user data. */ export const sampleUserData: User[] = [ { id: 101, name: 'Alice' }, { id: 102, name: 'Bob' }, { id: 103, name: 'Caroline' }, { id: 104, name: 'Dave' }, ]
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/functions/gtag.tsx
functions/gtag.tsx
export const GA_TRACKING_ID = "UA-132344171-4"; export const GA4_ID = "G-Y7P28R1T38"; // https://developers.google.com/analytics/devguides/collection/gtagjs/pages export const pageview = (url: URL) => { window.gtag("config", GA_TRACKING_ID, { page_path: url }); window.gtag("config", GA4_ID, { page_path: ...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/functions/constants.tsx
functions/constants.tsx
export const DOMAIN = "https://reddium.vercel.app"; export const REDIRECT_URI = "https://reddium.vercel.app/login"; export const CLIENT_ID = "DT8MZ0k_rAtJ8w"; // export const REDIRECT_URI = "http://localhost:3000/login"; // export const CLIENT_ID = "RCOnAetgJAnYxQ"; export const CHILDREN_CONTENT = "\n\n\n\n\n\n\n\n\n...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/functions/common.tsx
functions/common.tsx
import { capitalize } from "lodash"; const DAY_MILLISECONDS = 1000 * 60 * 60 * 24; const HOUR_MILLISECONDS = 1000 * 60 * 60; export function getTime(unixTime: number) { const postedTime = unixTime * 1000; const timeDiff = Date.now() - postedTime; if (timeDiff < HOUR_MILLISECONDS) { return `${Math.floor((tim...
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
eightants/reddium
https://github.com/eightants/reddium/blob/e5fe29847a11b88efed693a7a22f67723d3873b5/functions/service.tsx
functions/service.tsx
import { Post, QueryParams } from "../interfaces"; import { SPECIAL_SUBREDDITS } from "./constants"; export async function getPopularPosts({ subreddit = "popular", sort_type = "hot", t = "day", limit = 25, after = "", token = "" }: QueryParams) { const url = token != "" ? `https://oauth.reddit....
typescript
MIT
e5fe29847a11b88efed693a7a22f67723d3873b5
2026-01-05T05:00:56.854133Z
false
receter/my-component-library
https://github.com/receter/my-component-library/blob/c4057f2ef074b61f5c879e8805d397c95c345a66/vite.config.ts
vite.config.ts
import { defineConfig } from 'vite' import { extname, relative, resolve } from 'path' import { fileURLToPath } from 'node:url' import { glob } from 'glob' import react from '@vitejs/plugin-react' import dts from 'vite-plugin-dts' import { libInjectCss } from 'vite-plugin-lib-inject-css' // https://vitejs.dev/config/ e...
typescript
MIT
c4057f2ef074b61f5c879e8805d397c95c345a66
2026-01-05T05:00:56.352440Z
false
receter/my-component-library
https://github.com/receter/my-component-library/blob/c4057f2ef074b61f5c879e8805d397c95c345a66/src/App.tsx
src/App.tsx
import { useState } from 'react' import reactLogo from './assets/react.svg' import viteLogo from '/vite.svg' import './App.css' import { Button, Label, Input } from '../'; function App() { const [count, setCount] = useState(0) const [inputCustomCountValue, setInputCustomCountValue] = useState(''); const handleC...
typescript
MIT
c4057f2ef074b61f5c879e8805d397c95c345a66
2026-01-05T05:00:56.352440Z
false
receter/my-component-library
https://github.com/receter/my-component-library/blob/c4057f2ef074b61f5c879e8805d397c95c345a66/src/main.tsx
src/main.tsx
import React from 'react' import ReactDOM from 'react-dom/client' import App from './App.tsx' import './index.css' ReactDOM.createRoot(document.getElementById('root')!).render( <React.StrictMode> <App /> </React.StrictMode>, )
typescript
MIT
c4057f2ef074b61f5c879e8805d397c95c345a66
2026-01-05T05:00:56.352440Z
false
receter/my-component-library
https://github.com/receter/my-component-library/blob/c4057f2ef074b61f5c879e8805d397c95c345a66/src/vite-env.d.ts
src/vite-env.d.ts
/// <reference types="vite/client" />
typescript
MIT
c4057f2ef074b61f5c879e8805d397c95c345a66
2026-01-05T05:00:56.352440Z
false
receter/my-component-library
https://github.com/receter/my-component-library/blob/c4057f2ef074b61f5c879e8805d397c95c345a66/lib/main.ts
lib/main.ts
export { Button } from './components/Button' export { Input } from './components/Input' export { Label } from './components/Label'
typescript
MIT
c4057f2ef074b61f5c879e8805d397c95c345a66
2026-01-05T05:00:56.352440Z
false
receter/my-component-library
https://github.com/receter/my-component-library/blob/c4057f2ef074b61f5c879e8805d397c95c345a66/lib/vite-env.d.ts
lib/vite-env.d.ts
/// <reference types="vite/client" />
typescript
MIT
c4057f2ef074b61f5c879e8805d397c95c345a66
2026-01-05T05:00:56.352440Z
false
receter/my-component-library
https://github.com/receter/my-component-library/blob/c4057f2ef074b61f5c879e8805d397c95c345a66/lib/components/Label/index.tsx
lib/components/Label/index.tsx
import styles from './styles.module.css' export function Label(props: React.LabelHTMLAttributes<HTMLLabelElement>) { const { className, ...restProps } = props return <label className={`${className} ${styles.label}`} {...restProps} /> }
typescript
MIT
c4057f2ef074b61f5c879e8805d397c95c345a66
2026-01-05T05:00:56.352440Z
false
receter/my-component-library
https://github.com/receter/my-component-library/blob/c4057f2ef074b61f5c879e8805d397c95c345a66/lib/components/Input/index.tsx
lib/components/Input/index.tsx
import styles from './styles.module.css' export function Input(props: React.InputHTMLAttributes<HTMLInputElement>) { const { className, ...restProps } = props return <input className={`${className} ${styles.input}`} {...restProps} /> }
typescript
MIT
c4057f2ef074b61f5c879e8805d397c95c345a66
2026-01-05T05:00:56.352440Z
false
receter/my-component-library
https://github.com/receter/my-component-library/blob/c4057f2ef074b61f5c879e8805d397c95c345a66/lib/components/Button/index.tsx
lib/components/Button/index.tsx
import styles from './styles.module.css' export function Button(props: React.ButtonHTMLAttributes<HTMLButtonElement>) { const { className, ...restProps } = props return <button className={`${className} ${styles.button}`} {...restProps} /> }
typescript
MIT
c4057f2ef074b61f5c879e8805d397c95c345a66
2026-01-05T05:00:56.352440Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/jest.config.ts
jest.config.ts
import type { Config } from '@jest/types'; const config: Config.InitialOptions = { preset: 'ts-jest', testEnvironment: 'node', testRunner: 'jest-circus/runner', testMatch: ['<rootDir>/test/**/*.test.ts'], transform: { '^.+\\.ts$': [ 'ts-jest', { tsconfig: '<rootDir>/test/tsconfig.json', }, ], },...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/index.ts
src/index.ts
export * from './censor/BuiltinStrategies'; export * from './censor/TextCensor'; export * from './dataset/DataSet'; export * from './matcher/BlacklistedTerm'; export * from './matcher/Matcher'; export * from './matcher/MatchPayload'; export * from './matcher/regexp/RegExpMatcher'; export * from './pattern/Nodes'; exp...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/matcher/MatchPayload.ts
src/matcher/MatchPayload.ts
import { compareIntervals } from '../util/Interval'; /** * Information emitted on a successful match. * * If you require more information about matches than what is provided here, see * the [[DataSet]] class, which supports associating metadata with patterns. */ export interface MatchPayload { /** * End index ...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/matcher/IntervalCollection.ts
src/matcher/IntervalCollection.ts
import type { Interval } from '../util/Interval'; export class IntervalCollection implements Iterable<Interval> { private dirty = false; private readonly intervals: Interval[] = []; public insert(lowerBound: number, upperBound: number) { this.intervals.push([lowerBound, upperBound]); this.dirty = true; } p...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/matcher/Matcher.ts
src/matcher/Matcher.ts
import type { MatchPayload } from './MatchPayload'; /** * Searches for blacklisted terms in text, ignoring parts matched by whitelisted * terms. * * See: * - [[RegExpMatcher]] for an implementation using regular expressions. */ export interface Matcher { /** * Returns all matches of blacklisted terms in the t...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/matcher/BlacklistedTerm.ts
src/matcher/BlacklistedTerm.ts
import type { ParsedPattern } from '../pattern/Nodes'; /** * Represents a blacklisted term. */ export interface BlacklistedTerm { /** * The identifier of the pattern; should be unique across all patterns. */ id: number; /** * The parsed pattern. */ pattern: ParsedPattern; } /** * Assigns incrementing ...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/matcher/regexp/RegExpMatcher.ts
src/matcher/regexp/RegExpMatcher.ts
import { compilePatternToRegExp, potentiallyMatchesEmptyString } from '../../pattern/Util'; import { TransformerSet } from '../../transformer/TransformerSet'; import type { TransformerContainer } from '../../transformer/Transformers'; import { isHighSurrogate, isLowSurrogate } from '../../util/Char'; import { Character...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/preset/english.ts
src/preset/english.ts
import { DataSet } from '../dataset/DataSet'; import type { RegExpMatcherOptions } from '../matcher/regexp/RegExpMatcher'; import { pattern } from '../pattern/Pattern'; import { collapseDuplicatesTransformer } from '../transformer/collapse-duplicates'; import { resolveConfusablesTransformer } from '../transformer/resol...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/util/CharacterIterator.ts
src/util/CharacterIterator.ts
import { convertSurrogatePairToCodePoint, isHighSurrogate, isLowSurrogate } from './Char'; export class CharacterIterator implements IterableIterator<number> { private _input: string; private lastPosition = -1; private currentPosition = 0; private _lastWidth = 0; public constructor(input?: string) { this._i...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/util/Char.ts
src/util/Char.ts
export const enum CharacterCode { LowerA = 97, LowerZ = 122, UpperA = 65, UpperZ = 90, Zero = 48, Nine = 57, LeftSquareBracket = 91, RightSquareBracket = 93, QuestionMark = 63, Backslash = 92, Newline = 10, VerticalBar = 124, HighSurrogateStart = 0xd800, HighSurrogateEnd = 0xdbff, LowSurrogateStart = ...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/util/Interval.ts
src/util/Interval.ts
export function compareIntervals(lowerBound0: number, upperBound0: number, lowerBound1: number, upperBound1: number) { if (lowerBound0 < lowerBound1) return -1; if (lowerBound1 < lowerBound0) return 1; if (upperBound0 < upperBound1) return -1; if (upperBound1 < upperBound0) return 1; return 0; } export type Inter...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/censor/TextCensor.ts
src/censor/TextCensor.ts
import type { MatchPayload } from '../matcher/MatchPayload'; import { compareMatchByPositionAndId } from '../matcher/MatchPayload'; import { grawlixCensorStrategy } from './BuiltinStrategies'; /** * Censors regions of text matched by a [[Matcher]], supporting flexible * [[TextCensorStrategy | censoring strategies]]....
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/censor/BuiltinStrategies.ts
src/censor/BuiltinStrategies.ts
import { getAndAssertSingleCodePoint } from '../util/Char'; import type { CensorContext, TextCensorStrategy } from './TextCensor'; /** * A text censoring strategy that extends another strategy, adding the first * character matched at the start of the generated string. * * @example * ```typescript * const strateg...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/dataset/DataSet.ts
src/dataset/DataSet.ts
import { assignIncrementingIds } from '../matcher/BlacklistedTerm'; import type { MatchPayload } from '../matcher/MatchPayload'; import type { RegExpMatcherOptions } from '../matcher/regexp/RegExpMatcher'; import type { ParsedPattern } from '../pattern/Nodes'; /** * Holds phrases (groups of patterns and whitelisted t...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/transformer/TransformerSet.ts
src/transformer/TransformerSet.ts
import type { StatefulTransformer, TransformerContainer } from './Transformers'; import { TransformerType } from './Transformers'; export class TransformerSet { private readonly transformers: TransformerContainer[]; private readonly statefulTransformers: (StatefulTransformer | undefined)[]; public constructor(tra...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/transformer/Transformers.ts
src/transformer/Transformers.ts
/** * All the possible transformer types. */ export const enum TransformerType { Simple, Stateful, } /** * All the possible transformer container types. */ export type TransformerContainer = SimpleTransformerContainer | StatefulTransformerContainer; /** * Creates a container holding the transformer function pr...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/transformer/to-ascii-lowercase/index.ts
src/transformer/to-ascii-lowercase/index.ts
import { invertCaseOfAlphabeticChar, isUpperCase } from '../../util/Char'; import { createSimpleTransformer } from '../Transformers'; /** * Creates a transformer that changes all ASCII alphabet characters to * lower-case, leaving other characters unchanged. * * **Application order** * * It is recommended that th...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/transformer/collapse-duplicates/transformer.ts
src/transformer/collapse-duplicates/transformer.ts
import type { StatefulTransformer } from '../Transformers'; import type { ProcessedCollapseDuplicatesTransformerOptions } from '.'; export class CollapseDuplicatesTransformer implements StatefulTransformer { private readonly defaultThreshold: number; private readonly customThresholds: Map<number, number>; private...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/transformer/collapse-duplicates/index.ts
src/transformer/collapse-duplicates/index.ts
import { getAndAssertSingleCodePoint } from '../../util/Char'; import { createStatefulTransformer } from '../Transformers'; import { CollapseDuplicatesTransformer } from './transformer'; /** * Creates a transformer that collapses duplicate characters. This is useful for * detecting variants of patterns in which a ch...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/transformer/remap-characters/index.ts
src/transformer/remap-characters/index.ts
import { getAndAssertSingleCodePoint } from '../../util/Char'; import { CharacterIterator } from '../../util/CharacterIterator'; import { createSimpleTransformer } from '../Transformers'; /** * Maps certain characters to other characters, leaving other characters * unchanged. * * **Application order** * * It is ...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/transformer/skip-non-alphabetic/index.ts
src/transformer/skip-non-alphabetic/index.ts
import { isAlphabetic } from '../../util/Char'; import { createSimpleTransformer } from '../Transformers'; /** * Creates a transformer that skips non-alphabetic characters (`a`-`z`, * `A`-`Z`). This is useful when matching text on patterns that are solely * comprised of alphabetic characters (the pattern `hello` do...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/transformer/resolve-confusables/confusables.ts
src/transformer/resolve-confusables/confusables.ts
/** * Maps confusable Unicode characters to their normalized equivalents. * * @copyright * The data here is taken from the * [confusables](https://github.com/gc/confusables) library. * * ```text * # The MIT License (MIT) * * Copyright © 2019 https://github.com/gc/ * * Permission is hereby granted, free of c...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/transformer/resolve-confusables/index.ts
src/transformer/resolve-confusables/index.ts
import { remapCharactersTransformer } from '../remap-characters'; import { confusables } from './confusables'; /** * Creates a transformer that maps confusable Unicode characters to their * normalized equivalent. For example, `⓵`, `➊`, and `⑴` become `1` when using * this transformer. * * **Application order** *...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/transformer/resolve-leetspeak/dictionary.ts
src/transformer/resolve-leetspeak/dictionary.ts
export const dictionary = new Map([ ['a', '@4'], ['c', '('], ['e', '3'], ['g', '6'], ['i', '1|!'], ['l', '/'], ['o', '0'], ['s', '$5'], ['t', '7'], ['z', '2'], ]);
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/transformer/resolve-leetspeak/index.ts
src/transformer/resolve-leetspeak/index.ts
import { remapCharactersTransformer } from '../remap-characters'; import { dictionary } from './dictionary'; /** * Creates a transformer that maps leet-speak characters to their normalized * equivalent. For example, `$` becomes `s` when using this transformer. * * **Application order** * * It is recommended that...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/pattern/Parser.ts
src/pattern/Parser.ts
import { CharacterCode, convertSurrogatePairToCodePoint, isHighSurrogate, isLowSurrogate } from '../util/Char'; import { CharacterIterator } from '../util/CharacterIterator'; import type { BoundaryAssertionNode, LiteralNode, Node, OptionalNode, ParsedPattern, WildcardNode } from './Nodes'; import { SyntaxKind } from '....
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/pattern/ParserError.ts
src/pattern/ParserError.ts
/** * Custom error thrown by the parser when syntactical errors are detected. */ export class ParserError extends Error { public readonly name = 'ParserError'; /** * The line on which the error occurred (one-based). */ public readonly line: number; /** * The column on which the error occurred (one-based)....
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/pattern/Nodes.ts
src/pattern/Nodes.ts
/** * A parsed pattern. */ export interface ParsedPattern { /** * A list of nodes which make up the pattern. */ nodes: Node[]; /** * Whether the pattern requires a word boundary at the end. */ requireWordBoundaryAtEnd: boolean; /** * Whether the pattern requires a word boundary at the start. */ re...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/pattern/Util.ts
src/pattern/Util.ts
import type { Node, ParsedPattern } from './Nodes'; import { SyntaxKind } from './Nodes'; export function potentiallyMatchesEmptyString(pattern: ParsedPattern) { return pattern.nodes.every((node) => node.kind === SyntaxKind.Optional); } export function compilePatternToRegExp(pattern: ParsedPattern) { let regExpStr ...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/src/pattern/Pattern.ts
src/pattern/Pattern.ts
import { Parser } from './Parser'; const parser = new Parser(); /** * Parses a pattern, which matches a set of strings; see the `Syntax` section * for details. This function is intended to be called as a [template * tag](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_tem...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/jest.setup.ts
test/jest.setup.ts
expect.extend({ toBePermutationOf<T>(this: jest.MatcherContext, received: T[], expected: T[]) { const options = { isNot: this.isNot, promise: this.promise, }; if (received.length !== expected.length) { return { message: () => `${this.utils.matcherHint('toBePermutationOf', undefined, undefined, opti...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/matcher/BlacklistedTerm.test.ts
test/matcher/BlacklistedTerm.test.ts
import { assignIncrementingIds } from '../../src/matcher/BlacklistedTerm'; import { pattern } from '../../src/pattern/Pattern'; describe('assignIncrementingIds()', () => { it('should assign incrementing, unique IDs to the input patterns', () => { const firstPattern = pattern`|world|`; const secondPattern = patter...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/matcher/MatchPayload.test.ts
test/matcher/MatchPayload.test.ts
import { compareMatchByPositionAndId } from '../../src/matcher/MatchPayload'; import { compareIntervals as _compareIntervals } from '../../src/util/Interval'; jest.mock('../../src/util/Interval', () => ({ compareIntervals: jest.fn().mockReturnValue(0) })); const compareIntervals = _compareIntervals as jest.MockedFunc...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/matcher/IntervalCollection.test.ts
test/matcher/IntervalCollection.test.ts
import { IntervalCollection } from '../../src/matcher/IntervalCollection'; let coll: IntervalCollection; beforeEach(() => { coll = new IntervalCollection(); }); describe('IntervalCollection#insert()', () => { it('should add the interval to the collection', () => { coll.insert(5, 10); expect([...coll]).toBePerm...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/matcher/regexp/RegExpMatcher.test.ts
test/matcher/regexp/RegExpMatcher.test.ts
import { assignIncrementingIds } from '../../../src/matcher/BlacklistedTerm'; import type { MatchPayload } from '../../../src/matcher/MatchPayload'; import { RegExpMatcher } from '../../../src/matcher/regexp/RegExpMatcher'; import { parseRawPattern, pattern } from '../../../src/pattern/Pattern'; import { englishDataset...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/util/CharacterIterator.test.ts
test/util/CharacterIterator.test.ts
import { CharacterCode } from '../../src/util/Char'; import { CharacterIterator } from '../../src/util/CharacterIterator'; describe('constructor', () => { it('should default the input to an empty string if not provided', () => { expect(new CharacterIterator(undefined).input).toBe(''); }); it('should set the inpu...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/util/Interval.test.ts
test/util/Interval.test.ts
import { compareIntervals } from '../../src/util/Interval'; describe('compareIntervals()', () => { it("should return -1 if the first interval's lower bound is less than the second's", () => { expect(compareIntervals(1, 5, 2, 3)).toBe(-1); }); it("should return 1 if the second interval's lower bound is less than ...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/util/Char.test.ts
test/util/Char.test.ts
import { CharacterCode, convertSurrogatePairToCodePoint, getAndAssertSingleCodePoint, invertCaseOfAlphabeticChar, isAlphabetic, isDigit, isHighSurrogate, isLowerCase, isLowSurrogate, isUpperCase, isWordChar, } from '../../src/util/Char'; describe('CharacterCode()', () => { describe.each([ ['LowerA', Char...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/util/CharacterIterator.fuzz.test.ts
test/util/CharacterIterator.fuzz.test.ts
import * as fc from 'fast-check'; import { CharacterIterator } from '../../src/util/CharacterIterator'; test('the result of the character iterator over a string s should be equal to spreading s and mapping each value into its codepoint', () => { fc.assert( fc.property(fc.string16bits(), (str) => { const expected...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/censor/BuiltinStrategies.test.ts
test/censor/BuiltinStrategies.test.ts
import { asteriskCensorStrategy, fixedCharCensorStrategy, fixedPhraseCensorStrategy, grawlixCensorStrategy, keepEndCensorStrategy, keepStartCensorStrategy, randomCharFromSetCensorStrategy, } from '../../src/censor/BuiltinStrategies'; import type { CensorContext } from '../../src/censor/TextCensor'; const partia...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/censor/TextCensor.test.ts
test/censor/TextCensor.test.ts
import { grawlixCensorStrategy } from '../../src/censor/BuiltinStrategies'; import type { CensorContext } from '../../src/censor/TextCensor'; import { TextCensor } from '../../src/censor/TextCensor'; describe('TextCensor#setStrategy()', () => { it('should return the text censor', () => { const censor = new TextCens...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/dataset/DataSet.test.ts
test/dataset/DataSet.test.ts
import { DataSet, PhraseBuilder } from '../../src/dataset/DataSet'; import { pattern } from '../../src/pattern/Pattern'; describe('DataSet#addAll()', () => { it('should add all the data from the other dataset to the current one', () => { const other = new DataSet() .addPhrase((phrase) => phrase.addPattern(patter...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/transformer/TransformerSet.test.ts
test/transformer/TransformerSet.test.ts
import { TransformerSet } from '../../src/transformer/TransformerSet'; import type { StatefulTransformer } from '../../src/transformer/Transformers'; import { createSimpleTransformer, createStatefulTransformer } from '../../src/transformer/Transformers'; it('should create multiple instances of stateful transformers', ...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/transformer/Transformers.test.ts
test/transformer/Transformers.test.ts
import type { StatefulTransformer } from '../../src/transformer/Transformers'; import { createSimpleTransformer, createStatefulTransformer, TransformerType, } from '../../src/transformer/Transformers'; describe('TransformerType', () => { describe('TransformerType.Simple', () => { it('should equal 0', () => { ...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/transformer/to-ascii-lowercase/index.test.ts
test/transformer/to-ascii-lowercase/index.test.ts
import { TransformerType } from '../../../src/transformer/Transformers'; import { toAsciiLowerCaseTransformer } from '../../../src/transformer/to-ascii-lowercase'; import { CharacterCode } from '../../../src/util/Char'; describe('toAsciiLowerCaseTransformer()', () => { it('should return a simple transformer container...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/transformer/collapse-duplicates/index.test.ts
test/transformer/collapse-duplicates/index.test.ts
import type { CollapseDuplicatesTransformerOptions } from '../../../src/transformer/collapse-duplicates/index'; import { collapseDuplicatesTransformer } from '../../../src/transformer/collapse-duplicates/index'; import { CollapseDuplicatesTransformer as _CollapseDuplicatesTransformer } from '../../../src/transformer/co...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/transformer/collapse-duplicates/transformer.test.ts
test/transformer/collapse-duplicates/transformer.test.ts
import { CollapseDuplicatesTransformer } from '../../../src/transformer/collapse-duplicates/transformer'; describe('CollapseDuplicatesTransformer#transform()', () => { describe('threshold selection', () => { it('should use the default threshold if there is no corresponding custom threshold', () => { const transf...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/transformer/remap-characters/index.test.ts
test/transformer/remap-characters/index.test.ts
import { remapCharactersTransformer } from '../../../src/transformer/remap-characters'; import { TransformerType } from '../../../src/transformer/Transformers'; import { CharacterCode } from '../../../src/util/Char'; describe('remapCharactersTransformer()', () => { it('should return a simple transformer container', (...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/transformer/skip-non-alphabetic/index.test.ts
test/transformer/skip-non-alphabetic/index.test.ts
import { skipNonAlphabeticTransformer } from '../../../src/transformer/skip-non-alphabetic'; import { TransformerType } from '../../../src/transformer/Transformers'; import { CharacterCode } from '../../../src/util/Char'; describe('skipNonAlphabeticTransformer()', () => { it('should return a simple transformer contai...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/transformer/resolve-confusables/index.test.ts
test/transformer/resolve-confusables/index.test.ts
import { resolveConfusablesTransformer } from '../../../src/transformer/resolve-confusables'; import { TransformerType } from '../../../src/transformer/Transformers'; import { CharacterCode } from '../../../src/util/Char'; describe('resolveConfusablesTransformer()', () => { it('should return a simple transformer cont...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/transformer/resolve-leetspeak/index.test.ts
test/transformer/resolve-leetspeak/index.test.ts
import { resolveLeetSpeakTransformer } from '../../../src/transformer/resolve-leetspeak'; import { TransformerType } from '../../../src/transformer/Transformers'; import { CharacterCode } from '../../../src/util/Char'; describe('resolveLeetSpeakTransformer()', () => { it('should return a simple transformer container'...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/pattern/ParserError.test.ts
test/pattern/ParserError.test.ts
import { ParserError } from '../../src/pattern/ParserError'; describe('ParserError#name', () => { it("should be equal to 'ParserError'", () => { const err = new ParserError('', 0, 0); expect(err.name).toBe('ParserError'); }); }); describe('ParserError#line', () => { it('should be equal to the value passed to t...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/pattern/Pattern.test.ts
test/pattern/Pattern.test.ts
import { Parser } from '../../src/pattern/Parser'; import { parseRawPattern, pattern } from '../../src/pattern/Pattern'; const parser = new Parser(); describe('pattern template tag', () => { it('should parse the pattern given', () => { expect(pattern`hello world?`).toStrictEqual(parser.parse('hello world?')); });...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/pattern/Util.test.ts
test/pattern/Util.test.ts
import type { LiteralNode, OptionalNode } from '../../src/pattern/Nodes'; import { SyntaxKind } from '../../src/pattern/Nodes'; import { compilePatternToRegExp, getRegExpStringForNode, potentiallyMatchesEmptyString } from '../../src/pattern/Util'; import { CharacterIterator } from '../../src/util/CharacterIterator'; f...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
jo3-l/obscenity
https://github.com/jo3-l/obscenity/blob/37cc15c10c3e65197ad2f0b548e2eaaa0776896a/test/pattern/Parser.test.ts
test/pattern/Parser.test.ts
import { SyntaxKind } from '../../src/pattern/Nodes'; import { Parser } from '../../src/pattern/Parser'; import { ParserError } from '../../src/pattern/ParserError'; import { CharacterCode } from '../../src/util/Char'; import { CharacterIterator } from '../../src/util/CharacterIterator'; const parser = new Parser(); ...
typescript
MIT
37cc15c10c3e65197ad2f0b548e2eaaa0776896a
2026-01-05T05:01:00.718403Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/tailwind.config.ts
tailwind.config.ts
import tailwindTypography from "@tailwindcss/typography"; import tailwindAnimate from "tailwindcss-animate"; import type { Config } from "tailwindcss"; const config: Config = { content: [ "./pages/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}", "./app/**/*.{ts,tsx}", "./src/**/*.{ts,tsx}", ], dark...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/next-env.d.ts
next-env.d.ts
/// <reference types="next" /> /// <reference types="next/image-types/global" /> /// <reference path="./.next/types/routes.d.ts" /> // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/cssVariables.ts
src/cssVariables.ts
// Keep these in sync with the CSS variables in your tailwind configuration export const cssVariables = { breakpoints: { "3xl": 1920, "2xl": 1536, xl: 1280, lg: 1024, md: 768, sm: 640, }, };
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/middleware.ts
src/middleware.ts
import createMiddleware from "next-intl/middleware"; import { routing } from "./i18n/routing"; export default createMiddleware(routing); export const config = { // Match only internationalized pathnames matcher: ["/", "/(pl|en)/:path*", "/((?!api|_next|next|admin|route|proxy|.*\\..*).*)"], };
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/payload.config.ts
src/payload.config.ts
import path from "path"; import { fileURLToPath } from "url"; import { mongooseAdapter } from "@payloadcms/db-mongodb"; import { s3Storage } from "@payloadcms/storage-s3"; import { en } from "@payloadcms/translations/languages/en"; import { pl } from "@payloadcms/translations/languages/pl"; import { buildConfig } from...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/payload-types.ts
src/payload-types.ts
/* tslint:disable */ /* eslint-disable */ /** * This file was automatically generated by Payload. * DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config, * and re-run `payload generate:types` to regenerate this file. */ /** * Supported timezones in IANA format. * * This interface was referenced ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
true
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/environment.d.ts
src/environment.d.ts
/* eslint-disable */ import type en from "../translations/en.json"; type Messages = typeof en; declare global { namespace NodeJS { interface ProcessEnv { PAYLOAD_SECRET: string; DATABASE_URI: string; NEXT_PUBLIC_SERVER_URL: string; VERCEL_PROJECT_PRODUCTION_URL: string; } } inter...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/schemas/registerForm.schema.ts
src/schemas/registerForm.schema.ts
import { useTranslations } from "next-intl"; import { z } from "zod"; export type RegisterFormData = { email: string; password: string; confirmPassword: string; }; export const RegisterFormSchemaServer = z .object({ email: z.string().nonempty().email(), password: z.string().nonempty().min(8), conf...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/schemas/changePasswordModalForm.schema.ts
src/schemas/changePasswordModalForm.schema.ts
import { useTranslations } from "next-intl"; import { z } from "zod"; export type ChangePasswordModalFormData = { oldPassword: string; newPassword: string; confirmPassword: string; }; export const useChangePasswordModalForm = () => { const t = useTranslations("Account.settings.password-form.errors"); const...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/schemas/checkoutForm.schema.ts
src/schemas/checkoutForm.schema.ts
import { useTranslations } from "next-intl"; import { z } from "zod"; export const CheckoutFormSchemaServer = z.object({ buyerType: z.string().nonempty(), individualInvoice: z.boolean(), invoice: z .object({ name: z.string().nonempty(), address: z.string().nonempty(), city: z.string().nonem...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/schemas/ResetPasswordFormSchema.ts
src/schemas/ResetPasswordFormSchema.ts
import { useTranslations } from "next-intl"; import { z } from "zod"; export type ResetPasswordFormData = { newPassword: string; confirmPassword: string; }; export const useResetPasswordForm = () => { const t = useTranslations("ResetPasswordForm.errors"); const ResetPasswordForm = z .object({ newPa...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/schemas/loginForm.schema.ts
src/schemas/loginForm.schema.ts
import { useTranslations } from "next-intl"; import { z } from "zod"; export type LoginFormData = { email: string; password: string; }; export const useLoginFormSchema = () => { const t = useTranslations("LoginForm.errors"); const LoginFormSchema = z.object({ email: z.string().nonempty(t("email-empty"))....
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/app/(payload)/layout.tsx
src/app/(payload)/layout.tsx
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ import config from '@payload-config' import '@payloadcms/next/css' import type { ServerFunctionClient } from 'payload' import { handleServerFunctions, RootLayout } from '@payloadcms/next/layouts' im...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/app/(payload)/admin/[[...segments]]/page.tsx
src/app/(payload)/admin/[[...segments]]/page.tsx
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ import type { Metadata } from 'next' import config from '@payload-config' import { RootPage, generatePageMetadata } from '@payloadcms/next/views' import { importMap } from '../importMap' type Args...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/app/(payload)/admin/[[...segments]]/not-found.tsx
src/app/(payload)/admin/[[...segments]]/not-found.tsx
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ import type { Metadata } from 'next' import config from '@payload-config' import { NotFoundPage, generatePageMetadata } from '@payloadcms/next/views' import { importMap } from '../importMap' type ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/app/(payload)/api/graphql/route.ts
src/app/(payload)/api/graphql/route.ts
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ import config from '@payload-config' import { GRAPHQL_POST, REST_OPTIONS } from '@payloadcms/next/routes' export const POST = GRAPHQL_POST(config) export const OPTIONS = REST_OPTIONS(config)
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/app/(payload)/api/[...slug]/route.ts
src/app/(payload)/api/[...slug]/route.ts
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ import config from '@payload-config' import '@payloadcms/next/css' import { REST_DELETE, REST_GET, REST_OPTIONS, REST_PATCH, REST_POST, REST_PUT, } from '@payloadcms/next/routes' export...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false