Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

encore-helpers

Package Overview
Dependencies
Maintainers
8
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

encore-helpers - npm Package Compare versions

Comparing version 1.7.1 to 1.8.0

dist/mappers/index.d.ts

2

dist/constants/currencies.d.ts

@@ -1,4 +0,4 @@

import { StringDictionary } from '../typings/dictionary';
import { StringDictionary } from '../typings';
export declare const numbersAfterDot = 2;
export declare const currencySymbolMap: StringDictionary;
export declare const postfixes: StringDictionary;

@@ -0,3 +1,6 @@

import './typings';
export { mapDataConfig } from './mappers';
export { BEMClassGenerator, PublisherSubscriber } from './services';
export { truncate, withDeferredRendering } from './utils';
export { getProductPriceDetails, getCurrencySymbol, getFormattedPrice } from './utils';
export * from './typings';

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("logger",[],t):"object"==typeof exports?exports.logger=t():e.logger=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){!function(){if("undefined"!=typeof window)try{var e=new window.CustomEvent("test",{cancelable:!0});if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var n,r;return(t=t||{}).bubbles=!!t.bubbles,t.cancelable=!!t.cancelable,(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r=n.preventDefault,n.preventDefault=function(){r.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};t.prototype=window.Event.prototype,window.CustomEvent=t}}()},function(e,t,n){"use strict";n.r(t);n(0);var r=function(){function e(e){this.blockClassName=e}return e.prototype.getBlock=function(){return this.blockClassName},e.prototype.getBlockWithModifier=function(e){return this.blockClassName+"--"+e},e.prototype.getElement=function(e){return this.blockClassName+"__"+e},e.prototype.getElementWithModifier=function(e,t){return this.blockClassName+"__"+e+"--"+t},e}(),o=function(){function e(e){this.widgetName=e}return e.prototype.getEventName=function(e,t){var n=e?e+"_":"";return this.widgetName+"_"+n+t},e.prototype.emit=function(e,t,n,r){var o=this.getEventName(t,n),i=new CustomEvent(o,{detail:r});e.dispatchEvent(i)},e.prototype.globalEmit=function(e,t,n){this.emit(window,e,t,n)},e.prototype.subscribe=function(e,t,n,r){var o=this.getEventName(t,n),i=function(e){return r(e.detail)};return e.addEventListener(o,i),function(){e.removeEventListener(o,i)}},e.prototype.globalSubscribe=function(e,t,n){return this.subscribe(window,e,t,n)},e}();var i=
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("logger",[],t):"object"==typeof exports?exports.logger=t():e.logger=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){!function(){if("undefined"!=typeof window)try{var e=new window.CustomEvent("test",{cancelable:!0});if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var n,r;return(t=t||{}).bubbles=!!t.bubbles,t.cancelable=!!t.cancelable,(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r=n.preventDefault,n.preventDefault=function(){r.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};t.prototype=window.Event.prototype,window.CustomEvent=t}}()},function(e,t,n){"use strict";n.r(t);n(2);var r=function(e){var t=JSON.parse(JSON.stringify(e));for(var n in t)switch(t[n]){case"true":t[n]=!0;break;case"false":t[n]=!1}return t},o=(n(0),function(){function e(e){this.blockClassName=e}return e.prototype.getBlock=function(){return this.blockClassName},e.prototype.getBlockWithModifier=function(e){return this.blockClassName+"--"+e},e.prototype.getElement=function(e){return this.blockClassName+"__"+e},e.prototype.getElementWithModifier=function(e,t){return this.blockClassName+"__"+e+"--"+t},e}()),i=function(){function e(e){this.widgetName=e}return e.prototype.getEventName=function(e,t){var n=e?e+"_":"";return this.widgetName+"_"+n+t},e.prototype.emit=function(e,t,n,r){var o=this.getEventName(t,n),i=new CustomEvent(o,{detail:r});e.dispatchEvent(i)},e.prototype.globalEmit=function(e,t,n){this.emit(window,e,t,n)},e.prototype.subscribe=function(e,t,n,r){var o=this.getEventName(t,n),i=function(e){return r(e.detail)};return e.addEventListener(o,i),function(){e.removeEventListener(o,i)}},e.prototype.globalSubscribe=function(e,t,n){return this.subscribe(window,e,t,n)},e}();var u=
/**

@@ -9,2 +9,2 @@ shave - Shave is a javascript plugin that truncates multi-line text within a html element based on set max height

**/
function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw Error("maxHeight is required");var r="string"==typeof e?document.querySelectorAll(e):e;if(r){var o=n.character||"…",i=n.classname||"js-shave",u="boolean"!=typeof n.spaces||n.spaces,c='<span class="js-shave-char">'.concat(o,"</span>");"length"in r||(r=[r]);for(var a=0;a<r.length;a+=1){var l=r[a],s=l.style,f=l.querySelector(".".concat(i)),d=void 0===l.textContent?"innerText":"textContent";f&&(l.removeChild(l.querySelector(".js-shave-char")),l[d]=l[d]);var p=l[d],v=u?p.split(" "):p;if(!(v.length<2)){var b=s.height;s.height="auto";var h=s.maxHeight;if(s.maxHeight="none",l.offsetHeight<=t)s.height=b,s.maxHeight=h;else{for(var m=v.length-1,g=0,y=void 0;g<m;)y=g+m+1>>1,l[d]=u?v.slice(0,y).join(" "):v.slice(0,y),l.insertAdjacentHTML("beforeend",c),l.offsetHeight>t?m=u?y-1:y-2:g=y;l[d]=u?v.slice(0,m).join(" "):v.slice(0,m),l.insertAdjacentHTML("beforeend",c);var w=u?" ".concat(v.slice(m).join(" ")):v.slice(m),C=document.createTextNode(w),E=document.createElement("span");E.classList.add(i),E.style.display="none",E.appendChild(C),l.insertAdjacentElement("beforeend",E),s.height=b,s.maxHeight=h}}}}},u=function(e,t){void 0===t&&(t=3);var n=getComputedStyle(e),r=parseFloat(n.lineHeight);if(!isNaN(r)){var o=Math.ceil(r)*t;i(e,o)}},c={USD:"$",CAD:"$",AUD:"$",NZD:"$",EUR:"€",JPY:"¥",CNY:"¥",GBP:"£",SEK:""},a={USD:" USD",CAD:" CAD",AUD:" AUD",NZD:" NZD",JPY:" JPY",CNY:" CNY",SEK:"kr"},l=function(e,t){return""+s(t)+e.toFixed(2)+function(e){return a[e]||""}(t)},s=function(e){return void 0!==c[e]?c[e]:e.toUpperCase()},f=function(e,t,n){if(void 0===n&&(n="en-GB"),-1!==Object.keys(c).indexOf(t))return l(e,t);try{return new Intl.NumberFormat(n,{style:"currency",currency:t,maximumFractionDigits:2}).format(e).replace(/\u00a0/g," ")}catch(n){return l(e,t)}},d=function(e,t,n){void 0===n&&(n=2);var r=(e/Math.pow(10,n)).toString(),o=s(t),i=Number(r).toFixed(n).split("."),u=i[0],c=i[1];return{intPrice:u,cents:void 0===c?"":c,currencySymbol:o,currencyCode:t}},p=function(e,t,n){e.dataset.deferRendering&&"true"===e.dataset.deferRendering||n(e),new o(t).subscribe(window,null,"render",function(){return n(e)})};n.d(t,"BEMClassGenerator",function(){return r}),n.d(t,"PublisherSubscriber",function(){return o}),n.d(t,"truncate",function(){return u}),n.d(t,"withDeferredRendering",function(){return p}),n.d(t,"getProductPriceDetails",function(){return d}),n.d(t,"getCurrencySymbol",function(){return s}),n.d(t,"getFormattedPrice",function(){return f})}])});
function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw Error("maxHeight is required");var r="string"==typeof e?document.querySelectorAll(e):e;if(r){var o=n.character||"…",i=n.classname||"js-shave",u="boolean"!=typeof n.spaces||n.spaces,c='<span class="js-shave-char">'.concat(o,"</span>");"length"in r||(r=[r]);for(var a=0;a<r.length;a+=1){var s=r[a],l=s.style,f=s.querySelector(".".concat(i)),d=void 0===s.textContent?"innerText":"textContent";f&&(s.removeChild(s.querySelector(".js-shave-char")),s[d]=s[d]);var p=s[d],v=u?p.split(" "):p;if(!(v.length<2)){var b=l.height;l.height="auto";var h=l.maxHeight;if(l.maxHeight="none",s.offsetHeight<=t)l.height=b,l.maxHeight=h;else{for(var m=v.length-1,g=0,y=void 0;g<m;)y=g+m+1>>1,s[d]=u?v.slice(0,y).join(" "):v.slice(0,y),s.insertAdjacentHTML("beforeend",c),s.offsetHeight>t?m=u?y-1:y-2:g=y;s[d]=u?v.slice(0,m).join(" "):v.slice(0,m),s.insertAdjacentHTML("beforeend",c);var w=u?" ".concat(v.slice(m).join(" ")):v.slice(m),C=document.createTextNode(w),E=document.createElement("span");E.classList.add(i),E.style.display="none",E.appendChild(C),s.insertAdjacentElement("beforeend",E),l.height=b,l.maxHeight=h}}}}},c=function(e,t){void 0===t&&(t=3);var n=getComputedStyle(e),r=parseFloat(n.lineHeight);if(!isNaN(r)){var o=Math.ceil(r)*t;u(e,o)}},a={USD:"$",CAD:"$",AUD:"$",NZD:"$",EUR:"€",JPY:"¥",CNY:"¥",GBP:"£",SEK:""},s={USD:" USD",CAD:" CAD",AUD:" AUD",NZD:" NZD",JPY:" JPY",CNY:" CNY",SEK:"kr"},l=function(e,t){return""+f(t)+e.toFixed(2)+function(e){return s[e]||""}(t)},f=function(e){return void 0!==a[e]?a[e]:e.toUpperCase()},d=function(e,t,n){if(void 0===n&&(n="en-GB"),-1!==Object.keys(a).indexOf(t))return l(e,t);try{return new Intl.NumberFormat(n,{style:"currency",currency:t,maximumFractionDigits:2}).format(e).replace(/\u00a0/g," ")}catch(n){return l(e,t)}},p=function(e,t,n){void 0===n&&(n=2);var r=(e/Math.pow(10,n)).toString(),o=f(t),i=Number(r).toFixed(n).split("."),u=i[0],c=i[1];return{intPrice:u,cents:void 0===c?"":c,currencySymbol:o,currencyCode:t}},v=function(e,t,n){e.dataset.deferRendering&&"true"===e.dataset.deferRendering||n(e),new i(t).subscribe(window,null,"render",function(){return n(e)})};n.d(t,"mapDataConfig",function(){return r}),n.d(t,"BEMClassGenerator",function(){return o}),n.d(t,"PublisherSubscriber",function(){return i}),n.d(t,"truncate",function(){return c}),n.d(t,"withDeferredRendering",function(){return v}),n.d(t,"getProductPriceDetails",function(){return p}),n.d(t,"getCurrencySymbol",function(){return f}),n.d(t,"getFormattedPrice",function(){return d})},function(e,t){}])});
{
"name": "encore-helpers",
"version": "1.7.1",
"version": "1.8.0",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "types": "dist/index.d.ts",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc