@cuemath/web-utils 1.0.3-beta.1 → 1.0.3

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.
@@ -8,7 +8,7 @@ export declare const DAY: {
8
8
  Sat: string;
9
9
  };
10
10
  export declare const shorthandWeekDayArray: string[];
11
- export declare const MONTH_ARRAY: string[];
11
+ export declare const monthArray: string[];
12
12
  export declare const weekDayArray: string[];
13
13
  export declare const TWENTY_FOUR_HOURS_IN_SECONDS: number;
14
14
  export declare const HOUR_FORMAT: {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HOUR_FORMAT = exports.TWENTY_FOUR_HOURS_IN_SECONDS = exports.weekDayArray = exports.MONTH_ARRAY = exports.shorthandWeekDayArray = exports.DAY = void 0;
3
+ exports.HOUR_FORMAT = exports.TWENTY_FOUR_HOURS_IN_SECONDS = exports.weekDayArray = exports.monthArray = exports.shorthandWeekDayArray = exports.DAY = void 0;
4
4
  exports.DAY = {
5
5
  Sun: 'Sunday',
6
6
  Mon: 'Monday',
@@ -11,7 +11,7 @@ exports.DAY = {
11
11
  Sat: 'Saturday',
12
12
  };
13
13
  exports.shorthandWeekDayArray = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'];
14
- exports.MONTH_ARRAY = [
14
+ exports.monthArray = [
15
15
  'Jan',
16
16
  'Feb',
17
17
  'Mar',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/date-time/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,GAAG,GAAG;IACjB,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,UAAU;CAChB,CAAC;AAEW,QAAA,qBAAqB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAEnE,QAAA,WAAW,GAAG;IACzB,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,KAAK;IACL,KAAK;IACL,KAAK;CACN,CAAC;AAEW,QAAA,YAAY,GAAa;IACpC,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV,QAAQ;IACR,UAAU;CACX,CAAC;AAEW,QAAA,4BAA4B,GAAW,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ;AAE7D,QAAA,WAAW,GAAG;IACzB,kBAAkB,EAAE,EAAE;IACtB,uBAAuB,EAAE,EAAE;CAC5B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/date-time/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,GAAG,GAAG;IACjB,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,UAAU;CAChB,CAAC;AAEW,QAAA,qBAAqB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAEnE,QAAA,UAAU,GAAG;IACxB,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,KAAK;IACL,KAAK;IACL,KAAK;CACN,CAAC;AAEW,QAAA,YAAY,GAAa;IACpC,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV,QAAQ;IACR,UAAU;CACX,CAAC;AAEW,QAAA,4BAA4B,GAAW,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ;AAE7D,QAAA,WAAW,GAAG;IACzB,kBAAkB,EAAE,EAAE;IACtB,uBAAuB,EAAE,EAAE;CAC5B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -4,5 +4,3 @@ export * from './local-storage';
4
4
  export * from './date-time-helper';
5
5
  export * from './object';
6
6
  export * from './growth-source';
7
- export * from './url';
8
- export * from './e-cna';
package/dist/index.js CHANGED
@@ -20,6 +20,4 @@ __exportStar(require("./local-storage"), exports);
20
20
  __exportStar(require("./date-time-helper"), exports);
21
21
  __exportStar(require("./object"), exports);
22
22
  __exportStar(require("./growth-source"), exports);
23
- __exportStar(require("./url"), exports);
24
- __exportStar(require("./e-cna"), exports);
25
23
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,8CAA4B;AAC5B,kDAAgC;AAChC,qDAAmC;AACnC,2CAAyB;AACzB,kDAAgC;AAChC,wCAAsB;AACtB,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,8CAA4B;AAC5B,kDAAgC;AAChC,qDAAmC;AACnC,2CAAyB;AACzB,kDAAgC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/web-utils",
3
- "version": "1.0.3-beta.1",
3
+ "version": "1.0.3",
4
4
  "description": "Shared web utils package",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -10,7 +10,7 @@ export const DAY = {
10
10
 
11
11
  export const shorthandWeekDayArray = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'];
12
12
 
13
- export const MONTH_ARRAY = [
13
+ export const monthArray = [
14
14
  'Jan',
15
15
  'Feb',
16
16
  'Mar',
package/src/index.ts CHANGED
@@ -4,5 +4,3 @@ export * from './local-storage';
4
4
  export * from './date-time-helper';
5
5
  export * from './object';
6
6
  export * from './growth-source';
7
- export * from './url';
8
- export * from './e-cna';
@@ -1 +0,0 @@
1
- export declare const showLaptopQuestion: () => boolean;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.showLaptopQuestion = void 0;
4
- const iso_country_code_1 = require("../constants/country/iso-country-code");
5
- const cookie_1 = require("../cookie");
6
- const showLaptopQuestion = () => {
7
- const cueCountryCode = (0, cookie_1.getCookie)('cue_country_code');
8
- return cueCountryCode === iso_country_code_1.COUNTRY_NAME_COUNTRY_CODE_MAP.INDIA;
9
- };
10
- exports.showLaptopQuestion = showLaptopQuestion;
11
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/e-cna/index.ts"],"names":[],"mappings":";;;AAAA,4EAA0G;AAC1G,sCAAsC;AAE/B,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,MAAM,cAAc,GAAG,IAAA,kBAAS,EAAC,kBAAkB,CAAC,CAAC;IAErD,OAAO,cAAc,KAAK,gDAAgB,CAAC,KAAK,CAAC;AACnD,CAAC,CAAC;AAJW,QAAA,kBAAkB,sBAI7B"}
@@ -1,3 +0,0 @@
1
- export declare const getUrlWithoutHash: (asPath: string) => string;
2
- export declare const getQueryField: (asPath: string, field: string) => string;
3
- export declare const getOrigin: () => string;
package/dist/url/index.js DELETED
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getOrigin = exports.getQueryField = exports.getUrlWithoutHash = void 0;
4
- const getUrlWithoutHash = (asPath) => {
5
- return asPath?.includes('#') ? asPath.split('#')[0] : asPath;
6
- };
7
- exports.getUrlWithoutHash = getUrlWithoutHash;
8
- const getQueryField = (asPath, field) => {
9
- const searchParams = asPath?.split('?') || [];
10
- const queryParams = searchParams.length > 1 ? searchParams[1] : '';
11
- const params = new URLSearchParams(queryParams);
12
- return params.get(field) || '';
13
- };
14
- exports.getQueryField = getQueryField;
15
- const getOrigin = () => {
16
- const { origin = '' } = typeof window !== 'undefined' && window.location ? window.location : {};
17
- return origin;
18
- };
19
- exports.getOrigin = getOrigin;
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/url/index.ts"],"names":[],"mappings":";;;AAAO,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAU,EAAE;IAC1D,OAAO,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAC/D,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B;AAEK,MAAM,aAAa,GAAG,CAAC,MAAc,EAAE,KAAa,EAAE,EAAE;IAC7D,MAAM,YAAY,GAAa,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IACxD,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEnE,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,WAAW,CAAC,CAAC;IAEhD,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;AACjC,CAAC,CAAC;AAPW,QAAA,aAAa,iBAOxB;AAEK,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,GACnB,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IAE1E,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AALW,QAAA,SAAS,aAKpB"}
@@ -1,8 +0,0 @@
1
- import { COUNTRY_NAME_COUNTRY_CODE_MAP as ISO_COUNTRY_CODE } from '../constants/country/iso-country-code';
2
- import { getCookie } from '../cookie';
3
-
4
- export const showLaptopQuestion = () => {
5
- const cueCountryCode = getCookie('cue_country_code');
6
-
7
- return cueCountryCode === ISO_COUNTRY_CODE.INDIA;
8
- };
package/src/url/index.ts DELETED
@@ -1,19 +0,0 @@
1
- export const getUrlWithoutHash = (asPath: string): string => {
2
- return asPath?.includes('#') ? asPath.split('#')[0] : asPath;
3
- };
4
-
5
- export const getQueryField = (asPath: string, field: string) => {
6
- const searchParams: string[] = asPath?.split('?') || [];
7
- const queryParams = searchParams.length > 1 ? searchParams[1] : '';
8
-
9
- const params = new URLSearchParams(queryParams);
10
-
11
- return params.get(field) || '';
12
- };
13
-
14
- export const getOrigin = () => {
15
- const { origin = '' } =
16
- typeof window !== 'undefined' && window.location ? window.location : {};
17
-
18
- return origin;
19
- };