@ecomplus/utils
Version:
JS utility functions to E-Com Plus (not only) related apps
90 lines (85 loc) • 2.56 kB
JavaScript
/**
* @namespace ecomUtils
*/
import { root } from './lib/globals.mjs'
import _self from './lib/self.mjs'
import _config from './lib/config.mjs'
import i18n from './methods/i18n.mjs'
import name from './methods/name.mjs'
import alphabeticalSort from './methods/alphabetical-sort.mjs'
import price from './methods/price.mjs'
import onPromotion from './methods/on-promotion.mjs'
import formatMoney from './methods/format-money.mjs'
import formatDate from './methods/format-date.mjs'
import findByProperty from './methods/find-by-property.mjs'
import findBySlug from './methods/find-by-slug.mjs'
import findByName from './methods/find-by-name.mjs'
import filterByParentSlug from './methods/filter-by-parent-slug.mjs'
import fullName from './methods/full-name.mjs'
import minQuantity from './methods/min-quantity.mjs'
import inStock from './methods/in-stock.mjs'
import searchedItems from './methods/searched-items.mjs'
import recommendedIds from './methods/recommended-ids.mjs'
import categoriesList from './methods/categories-list.mjs'
import specValues from './methods/spec-values.mjs'
import specTextValue from './methods/spec-text-value.mjs'
import specValueByText from './methods/spec-value-by-text.mjs'
import variationsGrids from './methods/variations-grids.mjs'
import gridTitle from './methods/grid-title.mjs'
import img from './methods/img.mjs'
import imgSizes from './methods/img-sizes.mjs'
import nickname from './methods/nickname.mjs'
import phone from './methods/phone.mjs'
import birthDate from './methods/birth-date.mjs'
import parsePhone from './methods/parse-phone.mjs'
import parseDate from './methods/parse-date.mjs'
import lineAddress from './methods/line-address.mjs'
import objectIdPad from './methods/object-id-pad.mjs'
import randomObjectId from './methods/random-object-id.mjs'
/**
* Global config values for E-Com Plus apps.
* @name ecomUtils#$ecomConfig
* @see $ecomConfig
* @type {Object.<string, *>}
* @example
* ecomUtils.$ecomConfig.get('store_id')
* // => 1011
*/
const $ecomConfig = root.$ecomConfig || _config
export {
_self,
_config,
$ecomConfig,
i18n,
name,
alphabeticalSort,
price,
onPromotion,
formatMoney,
formatDate,
findByProperty,
findBySlug,
findByName,
filterByParentSlug,
fullName,
minQuantity,
inStock,
searchedItems,
recommendedIds,
categoriesList,
specValues,
specTextValue,
specValueByText,
variationsGrids,
gridTitle,
img,
imgSizes,
nickname,
phone,
birthDate,
parsePhone,
parseDate,
lineAddress,
objectIdPad,
randomObjectId
}