@ikas/storefront-model-functions 6.1.0-beta.364 → 6.1.0-beta.366
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/utils/helper.d.ts +5 -0
- package/build/utils/helper.js +1 -1
- package/package.json +5 -5
package/build/index.d.ts
CHANGED
|
@@ -50,4 +50,4 @@ import * as IkasVariantValueFunctions from "./functions/variant-type/variant-val
|
|
|
50
50
|
export { IkasVariantValueFunctions };
|
|
51
51
|
import * as IkasVariantTypeFunctions from "./functions/variant-type";
|
|
52
52
|
export { IkasVariantTypeFunctions };
|
|
53
|
-
export { stringToSlug } from "./utils/helper";
|
|
53
|
+
export { stringToSlug, suggestEmailCorrection } from "./utils/helper";
|
package/build/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"./functions/blog/category/index.js";export{t as IkasBlogCategoryFunctions};import*as o from"./functions/blog/index.js";export{o as IkasBlogFunctions};import*as s from"./functions/brand/index.js";export{s as IkasBrandFunctions};import*as r from"./functions/category/path-item/index.js";export{r as IkasCategoryPathItemFunctions};import*as n from"./functions/category/index.js";export{n as IkasCategoryFunctions};import*as i from"./functions/checkout/index.js";export{i as IkasCheckoutFunctions};import*as a from"./functions/customer/address/index.js";export{a as IkasCustomerAddressFunctions};import*as e from"./functions/customer/attribute/index.js";export{e as IkasCustomerAttributeFunctions};import*as u from"./functions/customer/index.js";export{u as IkasCustomerFunctions};import*as c from"./functions/filter-category/index.js";export{c as IkasFilterCategoryFunctions};import*as p from"./functions/image/index.js";export{p as IkasImageFunctions};import*as m from"./functions/order/address/index.js";export{m as IkasOrderAddressFunctions};import*as d from"./functions/order/line-item/variant/value/index.js";export{d as IkasOrderLineItemVariantValueFunctions};import*as f from"./functions/order/line-item/variant/index.js";export{f as IkasOrderLineItemVariantFunctions};import*as x from"./functions/order/line-item/index.js";export{x as IkasOrderLineItemFunctions};import*as I from"./functions/order/index.js";export{I as IkasOrderFunctions};import*as k from"./functions/product/attribute-value/index.js";export{k as IkasProductAttributeValueFunctions};import*as F from"./functions/product/filter/index.js";export{F as IkasProductFilterFunctions};import*as j from"./functions/product/option-set/option/index.js";export{j as IkasProductOptionFunctions};import*as l from"./functions/product/option-set/index.js";export{l as IkasProductOptionSetFunctions};import*as g from"./functions/product/variant/price/index.js";export{g as IkasProductPriceFunctions};import*as y from"./functions/product/variant/index.js";export{y as IkasProductVariantFunctions};import*as v from"./functions/product/index.js";export{v as IkasProductFunctions};import*as
|
|
1
|
+
import*as t from"./functions/blog/category/index.js";export{t as IkasBlogCategoryFunctions};import*as o from"./functions/blog/index.js";export{o as IkasBlogFunctions};import*as s from"./functions/brand/index.js";export{s as IkasBrandFunctions};import*as r from"./functions/category/path-item/index.js";export{r as IkasCategoryPathItemFunctions};import*as n from"./functions/category/index.js";export{n as IkasCategoryFunctions};import*as i from"./functions/checkout/index.js";export{i as IkasCheckoutFunctions};import*as a from"./functions/customer/address/index.js";export{a as IkasCustomerAddressFunctions};import*as e from"./functions/customer/attribute/index.js";export{e as IkasCustomerAttributeFunctions};import*as u from"./functions/customer/index.js";export{u as IkasCustomerFunctions};import*as c from"./functions/filter-category/index.js";export{c as IkasFilterCategoryFunctions};import*as p from"./functions/image/index.js";export{p as IkasImageFunctions};import*as m from"./functions/order/address/index.js";export{m as IkasOrderAddressFunctions};import*as d from"./functions/order/line-item/variant/value/index.js";export{d as IkasOrderLineItemVariantValueFunctions};import*as f from"./functions/order/line-item/variant/index.js";export{f as IkasOrderLineItemVariantFunctions};import*as x from"./functions/order/line-item/index.js";export{x as IkasOrderLineItemFunctions};import*as I from"./functions/order/index.js";export{I as IkasOrderFunctions};import*as k from"./functions/product/attribute-value/index.js";export{k as IkasProductAttributeValueFunctions};import*as F from"./functions/product/filter/index.js";export{F as IkasProductFilterFunctions};import*as j from"./functions/product/option-set/option/index.js";export{j as IkasProductOptionFunctions};import*as l from"./functions/product/option-set/index.js";export{l as IkasProductOptionSetFunctions};import*as g from"./functions/product/variant/price/index.js";export{g as IkasProductPriceFunctions};import*as y from"./functions/product/variant/index.js";export{y as IkasProductVariantFunctions};import*as v from"./functions/product/index.js";export{v as IkasProductFunctions};import*as C from"./functions/raffle/index.js";export{C as IkasRaffleFunctions};import*as P from"./functions/variant-type/variant-value/index.js";export{P as IkasVariantValueFunctions};import*as V from"./functions/variant-type/index.js";export{V as IkasVariantTypeFunctions};export{stringToSlug,suggestEmailCorrection}from"./utils/helper.js";
|
package/build/utils/helper.d.ts
CHANGED
|
@@ -2,3 +2,8 @@ export declare const validatePhoneNumber: (str: string) => boolean;
|
|
|
2
2
|
export declare const stringToSlug: (str: string, withEncode?: boolean) => string;
|
|
3
3
|
export declare function formatDate(date: Date): string;
|
|
4
4
|
export declare const validateEmail: (str: string) => boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Suggests a corrected email for common domain typos using a fixed match list.
|
|
7
|
+
* Returns null when no correction applies or the result equals the input domain.
|
|
8
|
+
*/
|
|
9
|
+
export declare const suggestEmailCorrection: (email: string) => string | null;
|
package/build/utils/helper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasStorefrontConfig as
|
|
1
|
+
import{IkasStorefrontConfig as o}from"@ikas/storefront-config";var a=function(o){return/^\+?\d+$/.test(o)},t=function(o,a){void 0===a&&(a=!0),o=(o=o.replace(/^\s+|\s+$/g,"")).toLocaleLowerCase("tr-TR");for(var t="àáäâèéëêìíïîıòóöôùúüûñçşğ·/_,:;",l=0,m=t.length;l<m;l++)o=o.replace(new RegExp(t.charAt(l),"g"),"aaaaeeeeiiiiioooouuuuncsg------".charAt(l));return o=o.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-"),a?encodeURIComponent(o):o};function l(a){var t={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",hour12:!1},l=o.getCurrentLocale();function m(o){return!!new Intl.DateTimeFormat(o,{hour:"numeric"}).format(0).match(/\s/)}return"undefined"!=typeof navigator?t.hour12=m(navigator.language):t.hour12=m(l),new Intl.DateTimeFormat(l,t).format(a)}var m=function(o){return!(o.length>320)&&/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(o)},i={gmal:"gmail",gmai:"gmail",gmial:"gmail",gamil:"gmail",gmali:"gmail",gmaill:"gmail",gnail:"gmail",gmil:"gmail","gmaıl":"gmail",hotmal:"hotmail",hotmai:"hotmail",hotmial:"hotmail",hotamil:"hotmail",hotmali:"hotmail",hotmaill:"hotmail",hotnail:"hotmail",homail:"hotmail",hormail:"hotmail","hotmaıl":"hotmail",outlok:"outlook",outlool:"outlook",outllok:"outlook",oulook:"outlook",otlook:"outlook",yaho:"yahoo",yahho:"yahoo",yhoo:"yahoo",yahooo:"yahoo",iclod:"icloud",icoud:"icloud",iclould:"icloud",icluod:"icloud"},e=new Set(["gmail","hotmail","outlook","yahoo","icloud"]),c=new Set(["","co","cm","om"]),r={con:"com",cmo:"com",comm:"com",coom:"com",cpm:"com",vom:"com",xom:"com",ocm:"com","com.t":"com.tr","com.rt":"com.tr","co.tr":"com.tr","cm.tr":"com.tr","con.tr":"com.tr",nte:"net",nett:"net",ogr:"org",rog:"org"},n=function(o){var a=o.indexOf("@");if(a<=0||a===o.length-1)return null;var t=o.slice(0,a),l=o.slice(a+1),m=l.replace(/İ/g,"i").replace(/I/g,"i").replace(/[A-Z]/g,(function(o){return o.toLowerCase()})),n=m.indexOf("."),u=-1===n?m:m.slice(0,n),h=-1===n?"":m.slice(n+1),g=i[u]||u,f=h;e.has(g)&&(c.has(h)||"gmail"===g&&"com.tr"===h)&&(f="com"),r[f]&&(f=r[f]);var d=f?"".concat(g,".").concat(f):g;return d===m?null:"".concat(t,"@").concat(d)};export{l as formatDate,t as stringToSlug,n as suggestEmailCorrection,m as validateEmail,a as validatePhoneNumber};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront-model-functions",
|
|
3
|
-
"version": "6.1.0-beta.
|
|
3
|
+
"version": "6.1.0-beta.366",
|
|
4
4
|
"description": "Functions for ikas storefront models.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"build": "rm -rf build && rollup -c"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@ikas/storefront-config": "^6.1.0-beta.
|
|
20
|
-
"@ikas/storefront-models": "^6.1.0-beta.
|
|
19
|
+
"@ikas/storefront-config": "^6.1.0-beta.366",
|
|
20
|
+
"@ikas/storefront-models": "^6.1.0-beta.366",
|
|
21
21
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
22
22
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
23
23
|
"rollup-plugin-rename-node-modules": "^1.2.0",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"lodash": "^4.17.21"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@ikas/storefront-config": "^6.1.0-beta.
|
|
37
|
-
"@ikas/storefront-models": "^6.1.0-beta.
|
|
36
|
+
"@ikas/storefront-config": "^6.1.0-beta.366",
|
|
37
|
+
"@ikas/storefront-models": "^6.1.0-beta.366",
|
|
38
38
|
"lodash": "^4.17.21"
|
|
39
39
|
}
|
|
40
40
|
}
|