New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

oss-alphabroder

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oss-alphabroder

Alpha utility functions

latest
npmnpm
Version
1.0.16
Version published
Maintainers
1
Created
Source

Utility Functions for Alphabroder Web

npm i oss-alphabroder
import { checkWarehouses ,isProduction, isBrowser, eReports} from 'oss-alphabroder';

Purpose

This code contains a set of utility functions for the Alphabroder web application. These functions provide various services such as checking the production environment, checking warehouse codes, and converting decoration codes to decoration method names.

Functionality

  • isBrowser: A constant that checks if the code is running in a browser environment.
  • isProduction: A function that returns a boolean indicating whether the code is running in a production environment.
  • checkWarehouses: A function that takes in a warehouse code and a method, and returns the corresponding warehouse code.
  • getDecoMethodNameFromDecoCode: A function that takes in a decoration code and returns the corresponding decoration method name.
  • ossAurycData(): A function retrieves session metadata from the Auryc browser API and logs it to the console as a table. It also returns the metadata as an object. If an error occurs, it returns null.
  • ossAurycEvent(): A function that send an object to Auryc event meta-data.
  • asyncFnWithRetries(): A async function that executes the specified function with retries, catching any errors that occur.
  • matchInkSoftSequence() : A function that takes in a decoLocation object and tries to match the colors in the coordination_colors array with the colors in the artObjects array. If it fails to find a match, it will return a transparent color.

Code Implementation

The code is implemented using JavaScript and exports these functions as CommonJS modules to be used in other parts of the application.

Example Usage

Here is an example of how the checkWarehouses function could be used in the application:

import { checkWarehouses } from 'oss-alphabroder';

const warehouse = 'all';
const method = 'Embroidery';

const updatedWarehouse = checkWarehouses(warehouse, method);
console.log(updatedWarehouse); // Output: 'kd'
import { getDecoMethodNameFromDecoCode } from 'oss-alphabroder';

const decoCode = 'SCREEN';

const decoMethodName = getDecoMethodNameFromDecoCode(decoCode);
console.log(decoMethodName); // Output: 'Screen Print'

ossAurycData()

This function retrieves session metadata from the Auryc browser API and logs it to the console as a table. It also returns the metadata as an object. If an error occurs, it returns null.

Parameters

This function takes no parameters.

ossAurycEvent(properties)

This function adds event properties to the Auryc browser API. The properties are passed as an object to the function.

Parameters

properties (object): Object containing event properties to add. This function does not return a value.

import { ossAurycEvent } from 'oss-alphabroder';

ossAurycEvent({ pageName: 'Home', userLoggedIn: true , 'myCustomProperty': 'myCustomValue' });

asyncFnWithRetries(fn, maxRetries, retryDelay)

import { asyncFnWithRetries } from 'oss-alphabroder';
asyncFnWithRetries(fn, maxRetries, retryDelay)
/**
 * Executes the specified function with retries, catching any errors that occur.
 * @param fn The function to execute.
 * @param maxRetries The maximum number of retries.
 * @param retryDelay The delay between retries, in milliseconds.
 * @returns The result of the function, or null if an error occurs after all retries.
 */

Keywords

alphabroder

FAQs

Package last updated on 06 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts