Hyperse
  • Pricing
  • FAQs
Newsletter

Subscribe to our newsletter

Receive weekly updates with latest collections and exclusive offers, straight to your inbox.

Hyperse

Headless commerce solutions for brands, developers, and modern ecommerce teams.

Explore

  • Home
  • About Us
  • Partners
  • FAQs

Legal & resources

  • Proposal
  • Privacy Policy
  • Terms & Conditions

© 2026 Hyperse. All rights reserved.


  1. Home
  2. Vendure Plugins
  3. hps-common
hps-common

hps-common

By Hyperse

hps-common is a Hps Common plugin in the Hub Base group.hps-common provides Hps Common plugin capabilities for Hub Base. Shared open libraries, utilities, and testing foundations.

CoreVendure Plugins

Specifications

Technical details and package information for this product.

Package

@hyperse-hub/hps-common

Support by

Hyperse

Support languages

TypeScript, JavaScript, Prolog, Shell

Integration type

Core

Category

Vendure Plugins

Compatible with

^3.0.0

Latest version

1.1.4

Downloads

0

Repository

ssh://git@github.com/hyperse-hub/hub-base

Last published

July 02, 2026

Description
Changelog
loading...

@hyperse-hub/hps-common

Common utilities and shared types for Hub Base plugins.

Install

yarn add @hyperse-hub/hps-common

What is included

  • Crypto helpers (encrypt, decrypt) for AES-256-CBC scenarios
  • Vendure entity helper (safeAddCustomFields) to avoid duplicate custom fields
  • Merge helpers (mergeOption, mergeOptions, simpleDeepClone)
  • Utility families for array/date/file/get/omit/path/pdf/pick/price/string/tree/typeorm/unique
  • Shared utility types (DeepPartial, Nullable, SetOptional, SetRequired, UnionTuple, MutationUploadFile)

Exported modules

  • crypto: encrypt(), decrypt()
  • entities: safeAddCustomFields()
  • merge-options: mergeOption(), mergeOptions(), simpleDeepClone()
  • types: DeepPartial, Nullable, SetOptional, SetRequired, UnionTuple, MutationUploadFile
  • utils-array: arrayChunk(), arrayFlatten(), arrayFlattenDeep(), arraysIntersect(), arrayRemove(), arrayUnique()
  • utils-date: dateUtcToZonedTime()
  • utils-file: stream/buffer helpers, temp/read stream helpers, directory merge helpers, image helpers
  • utils-get: get()
  • utils-omit: omit()
  • utils-path: URL/path parsing and mutation helpers (getQueryString, getURLRoot, modifyQueryString, urlJoin, etc.)
  • utils-pdf: createPDF()
  • utils-pick: pick()
  • utils-price: price()
  • utils-str: string helpers (capitalize, ensureSlash, normalizeSlug, parseJson, truncateSentences, etc.)
  • utils-tree: tree conversion/traversal/update helpers
  • utils-typeorm: transformBitToBoolean()
  • utils-unique: unique()

Quick usage

import { encrypt, safeAddCustomFields, mergeOptions, arrayUnique, arraysIntersect, getURLRoot, modifyQueryString, parseJson, price, } from '@hyperse-hub/hps-common'; const ids = arrayUnique([1, 2, 2, 3]); // [1, 2, 3] const hasAdminRole = arraysIntersect(['admin', 'editor'], ['guest', 'admin']); // true const root = getURLRoot('https://example.com/path?a=1#hash'); // https://example.com/path const next = modifyQueryString('/login?redirect=%2Fhome', 'lang', 'en'); const payload = parseJson('{"enabled":true}', { enabled: false }); const amount = price('10.00').add('2.50').format(); const cipherKey = Buffer.alloc(32, 1); const encrypted = encrypt('hello', cipherKey); const merged = mergeOptions( { feature: { enabled: false } }, { feature: { enabled: true } } );

Vendure example

import { safeAddCustomFields } from '@hyperse-hub/hps-common'; safeAddCustomFields(config, 'Product', [ { name: 'badgeText', type: 'string', nullable: true, }, ]);

Development

yarn lint yarn test-unit yarn typecheck

Notes

  • arraysIntersect() compares object values by reference identity.
  • URL helpers support both absolute URLs and relative paths.
  • await file/image/pdf helpers in server-side environments (Node.js).

On this page

  • @hyperse-hub/hps-common
    • Install
    • What is included
    • Exported modules
    • Quick usage
    • Vendure example
    • Development
    • Notes