ChemPal Documentation - v1.18.0
    Preparing search index...

      ChemPal Documentation - v1.18.0

      Categories & Groups / Category

      Utils

      183 entries across 34 modules.

      utils/BadgeAnimator1

      • BadgeAnimator

        A utility class for managing Chrome extension badge animations and styling. Provides methods to animate the badge with different character sets, set colors, and control the animation timing. The badge can be used to show loading states, progress indicators, or other status information in the Chrome extension icon.

      utils/badgeController8

      utils/Cactus1

      • Cactus

        A client for the Cactus Chemical Identifier Resolver API.

        This class provides methods to retrieve various chemical information including names, structures, properties, and identifiers from the NCI Cactus service.

        API Documentation: https://cactus.nci.nih.gov/chemical/structure_documentation

        This service works as a resolver for different chemical structure identifiers and allows one to convert a given structure identifier into another representation or structure identifier. You can either use the web form of the resolver or the following simple URL API scheme:

        http:///chemical/structure/"structure identifier"/"representation"
        

        The service returns the requested new structure representation with a corresponding MIME-Type specification (in most cases MIME-Type: "text/plain"). If a requested URL is not resolvable for the service an HTML 404 status message is returned. In the (unlikely) case of an error, an HTML 500 status message is generated.

      utils/debugConsole1

      displayContext4

      utils/fuzzScorerLab19

      utils/idbCache49

      utils10

      utils/isDevBuild1

      • IS_DEV_BUILD

        Build-mode flag derived from Vite's import.meta.env.MODE.

        true for any non-production Vite build: the dev server (pnpm dev), --mode=development, --mode=aggregate, --mode=mock, and Vitest (which uses MODE === "test"). false only for --mode=production (i.e. pnpm build:prod).

        Vite replaces import.meta.env.MODE with a string literal at build time, so downstream if (!IS_DEV_BUILD) branches collapse to dead code in prod and are removed by Rollup's tree-shaking.

      utils/Logger7

      • LogLevel

        Available logging levels in ascending order of severity: TRACE → DEBUG → INFO → WARN → ERROR → FATAL

      • REMOTE_LOG_LEVELS

        Every severity bucket a remote log sink can opt into, least to most severe. Logger.info and Logger.log both map to 'log'.

      • RemoteLogLevel

        A severity bucket a remote log sink can opt into.

      • isRemoteLogLevel
      • RemoteLogRecord

        One log call as handed to a RemoteLogSink.

        • level - The remote severity bucket of the call.
        • prefix - The emitting logger's prefix (includes any sub() segments).
        • message - The message passed to the logger, before any formatting.
        • args - The extra arguments passed to the logger, unsanitized.
        • location - Where the call lives in the source, as path:line#function, when the build recorded it (see tools/logCallSites.js); otherwise undefined.
        • context - Key/value pairs describing what the app was doing when the call was made, such as the active search query (see Logger.setContext); undefined when there are none.
      • RemoteLogSink

        A destination that receives log calls in addition to the console, such as PostHog Logs. isEnabled is checked first so a disabled level costs no more than one function call.

        • isEnabled - Whether records at this level are currently wanted.
        • emit - Receives a record. Must not throw.
      • Logger

        A flexible logging utility that supports different log levels and prefixed output.

      utils/molecule/elements2

      utils/molecule/resolveMolecule2

      utils/molecule/scene3

      utils/molecule/sdf5

      utils/priceDropBadge7

      utils/ProductBuilder1

      • ProductBuilder

        Builder class for constructing Product objects with a fluent interface. Implements the Builder pattern to handle complex product construction with optional fields and data validation.

      reviewStats7

      utils/search-query/detectTermType2

      • SearchTermType

        The kind of thing a single search term looks like. Used purely to colorize the search box — it does not change search behavior.

      • detectTermType

      utils/search-query/evaluateAst3

      utils/search-query/extractPositiveTerms3

      utils/search-query/highlightSearchQuery6

      utils/search-query/parseSearchQuery3

      utils/search-query/translators/translateAstToContainsFilter3

      utils/search-query/translators/translateAstToFreefind1

      utils/search-query/translators/translateAstToShopifyQuery1

      utils/search-query/translators/translateAstToTypesenseFilter1

      utils/search-query/translators/translateAstToWixFilter1

      utils/search-query/types6

      • TermNode

        A single search phrase leaf (e.g. Potassium Permanganate).

      • AndNode

        Boolean AND of two sub-expressions.

      • OrNode

        Boolean OR of two sub-expressions.

      • NotNode

        Boolean negation of a sub-expression.

      • SearchAst

        A node in the normalized search-query tree.

      • ParsedSearchQuery

        The result of parsing a raw search string.

      utils/storage10

      utils/SupplierCache1

      • SupplierCache

        Utility class for managing supplier data caching in IndexedDB. Provides a robust caching system for both query results and product detail data.

      utils/SupplierStatsStore9

      themeIcon1

      utils/traceId2

      uuidv72

      • uuidv7

        RFC 9562 UUIDv7 generation. Ported by hand rather than adding a dependency — the format is small and fully specified, matching this project's existing preference for hand-rolling well-specified primitives over pulling in a package for one function (see src/helpers/analytics.ts's module doc for the same reasoning applied to not loading posthog-js).

      • generateUuidV7