1.0.9 • Published 6 years ago

valid-shopify-domain v1.0.9

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

Valid Shopify Domain

Ensure the provided .myshopify.com domain is valid meaning...

  • It ends with .myshopify.com
  • Has a store name that is greater than or equal to 4 characters and less than or equal to 60 charcters
  • Does not contain characters other than letters (a-z), numbers (0-9), dots, and hyphens.

Install

npm i -S valid-shopify-domain

Usage

import validShopifyDomain from 'valid-shopify-domain';

validShopifyDomain('store.myshopify.com'); // returns: store.myshopify.com

validShopifyDomain('store.myshpfy.com'); // throws: The provided domain did not end in .myshopify.com

validShopifyDomain('.myshopify.com'); // throws: You only provided ".myshopify.com" as the domain, a valid store name is required

validShopifyDomain('shp.myshopify.com'); // throws: The store name portion of the domain must be atleast 4 characters

validShopifyDomain('1111111111111111111111111111111111111111111111111111111111111.myshopify.com'); // throws: The provided domain contains too many characters (74 max)

validShopifyDomain('my!store.myshopify.com'); // throws: The provided domain must not contain characters other than letters (a-z), numbers (0-9), dots, and hyphens
1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago