Esposter
    Preparing search index...

    Module @esposter/shared - v2.25.0

    @esposter/shared

    Apache-2.0 licensed NPM version NPM downloads NPM Unpacked Size (with version)

    Shared TypeScript utilities, types, and error classes for the Esposter platform. Works in both browser and server environments.


    pnpm i @esposter/shared
    

    We highly recommend you take a look at the documentation to level up.

    import { InvalidOperationError, NotFoundError, ForbiddenError, NotInitializedError } from "@esposter/shared";

    throw new InvalidOperationError(Operation.Read, file.name, zodError.message);
    import { takeOne } from "@esposter/shared";

    // Safe index access — throws on out-of-bounds instead of returning undefined
    const first = takeOne(items, 0);
    import type { ToData, DeepOmit, GetPaths } from "@esposter/shared";

    // ToData<T> — strips class methods, returns plain data shape
    type RawColumn = ToData<Column>;
    import { toRawDeep, getRawData } from "@esposter/shared";

    // Recursively unwrap Vue reactive proxies
    const raw = toRawDeep(reactiveObject);
    import { capitalize, truncate, toKebabCase } from "@esposter/shared";
    
    import { getResult, getResultAsync, withFinalizer } from "@esposter/shared";
    

    Run from packages/shared/:

    pnpm build        # compile to dist/
    pnpm test # vitest watch mode
    pnpm coverage # vitest run --coverage
    pnpm lint:fix # auto-fix lint
    pnpm typecheck # type check

    This project is licensed under the Apache-2.0 license.

    Enumerations

    MentionType
    Operation

    Classes

    ForbiddenError
    InvalidOperationError
    ItemMetadata
    NotFoundError
    NotInitializedError
    Serializable

    Interfaces

    ClassifiedMentions
    ItemEntityType
    TakeOne
    WithMetadata

    Type Aliases

    BuildTuple
    DeepOmit
    DeepOptionalUndefined
    ExcludeFunctionProperties
    FunctionProperties
    GetArrayProps
    GetObjectProps
    GetPaths
    GetPrimitiveProps
    GetProperties
    KnownKeys
    MapValue
    MergeObjectsStrict
    PropertyNames
    RoutePath
    SkipFirst
    TakeFirst
    ToData
    TupleSlice
    TupleSplit
    TupleSplitHead
    TupleSplitTail

    Variables

    AllSpecialValues
    css
    html
    ID_SEPARATOR
    ItemEntityTypePropertyNames
    ItemMetadataPropertyNames
    itemMetadataSchema
    MENTION_EVERYONE_ID
    MENTION_HERE_ID
    MENTION_ID_ATTRIBUTE
    MENTION_ITEM_TYPE_ATTRIBUTE
    MENTION_LABEL_ATTRIBUTE
    MENTION_TYPE
    MENTION_TYPE_ATTRIBUTE
    NIL
    RoutePath
    SITE_NAME
    SURVEY_DISPLAY_NAME
    takeOne
    UUIDV4_REGEX

    Functions

    applyItemMetadataMixin
    capitalize
    classifyMentions
    createItemEntityTypeSchema
    escapeRegExp
    exhaustiveGuard
    getIsServer
    getMentions
    getPropertyNames
    getRawData
    getResult
    getResultAsync
    hrtime
    isPlainObject
    jsonDateParse
    mergeObjectsStrict
    noop
    normalizeString
    now
    streamToText
    toAppError
    toKebabCase
    toRawDeep
    truncate
    uncapitalize
    uuidValidateV4
    withFinalizer
    withFinalizerAsync