@dereekb/util 9.15.1 → 9.15.2
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/CHANGELOG.md +4 -0
- package/fetch/CHANGELOG.md +4 -0
- package/fetch/package.json +2 -2
- package/package.json +1 -1
- package/src/lib/value/address.d.ts +11 -0
- package/src/lib/value/address.js +12 -1
- package/src/lib/value/address.js.map +1 -1
- package/test/CHANGELOG.md +4 -0
- package/test/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [9.15.2](https://github.com/dereekb/dbx-components/compare/v9.15.1-dev...v9.15.2) (2022-11-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
## [9.15.1](https://github.com/dereekb/dbx-components/compare/v9.15.0-dev...v9.15.1) (2022-11-11)
|
|
6
10
|
|
|
7
11
|
|
package/fetch/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [9.15.2](https://github.com/dereekb/dbx-components/compare/v9.15.1-dev...v9.15.2) (2022-11-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
## [9.15.1](https://github.com/dereekb/dbx-components/compare/v9.15.0-dev...v9.15.1) (2022-11-11)
|
|
6
10
|
|
|
7
11
|
|
package/fetch/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/util/fetch",
|
|
3
|
-
"version": "9.15.
|
|
3
|
+
"version": "9.15.2",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"typings": "./src/index.d.ts",
|
|
6
6
|
"dependencies": {},
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@dereekb/util": "9.15.
|
|
8
|
+
"@dereekb/util": "9.15.2",
|
|
9
9
|
"lodash.isequal": "^4.5.0",
|
|
10
10
|
"make-error": "^1.3.0",
|
|
11
11
|
"class-validator": "^0.13.2",
|
package/package.json
CHANGED
|
@@ -30,5 +30,16 @@ export interface UnitedStatesAddress {
|
|
|
30
30
|
state: StateString | StateCodeString;
|
|
31
31
|
zip: ZipCodeString;
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Regex expression for all US states and territories.
|
|
35
|
+
*/
|
|
33
36
|
export declare const US_STATE_CODE_STRING_REGEX: RegExp;
|
|
34
37
|
export declare function isUsStateCodeString(input: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Simple regex expression for zip codes.
|
|
40
|
+
*
|
|
41
|
+
* Credit to:
|
|
42
|
+
*
|
|
43
|
+
* https://stackoverflow.com/a/19844362
|
|
44
|
+
*/
|
|
45
|
+
export declare const ZIP_CODE_STRING_REGEX: RegExp;
|
package/src/lib/value/address.js
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isUsStateCodeString = exports.US_STATE_CODE_STRING_REGEX = void 0;
|
|
3
|
+
exports.ZIP_CODE_STRING_REGEX = exports.isUsStateCodeString = exports.US_STATE_CODE_STRING_REGEX = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Regex expression for all US states and territories.
|
|
6
|
+
*/
|
|
4
7
|
exports.US_STATE_CODE_STRING_REGEX = /^((A[LKSZR])|(C[AOT])|(D[EC])|(F[ML])|(G[AU])|(HI)|(I[DLNA])|(K[SY])|(LA)|(M[EHDAINSOT])|(N[EVHJMYCD])|(MP)|(O[HKR])|(P[WAR])|(RI)|(S[CD])|(T[NX])|(UT)|(V[TIA])|(W[AVIY]))$/;
|
|
5
8
|
function isUsStateCodeString(input) {
|
|
6
9
|
return exports.US_STATE_CODE_STRING_REGEX.test(input);
|
|
7
10
|
}
|
|
8
11
|
exports.isUsStateCodeString = isUsStateCodeString;
|
|
12
|
+
/**
|
|
13
|
+
* Simple regex expression for zip codes.
|
|
14
|
+
*
|
|
15
|
+
* Credit to:
|
|
16
|
+
*
|
|
17
|
+
* https://stackoverflow.com/a/19844362
|
|
18
|
+
*/
|
|
19
|
+
exports.ZIP_CODE_STRING_REGEX = /^[a-z0-9][a-z0-9\- ]{0,10}[a-z0-9]$/;
|
|
9
20
|
//# sourceMappingURL=address.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/value/address.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/value/address.ts"],"names":[],"mappings":";;;AAuCA;;GAEG;AACU,QAAA,0BAA0B,GAAG,8KAA8K,CAAC;AAEzN,SAAgB,mBAAmB,CAAC,KAAa;IAC/C,OAAO,kCAA0B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAFD,kDAEC;AAED;;;;;;GAMG;AACU,QAAA,qBAAqB,GAAG,qCAAqC,CAAC"}
|
package/test/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [9.15.2](https://github.com/dereekb/dbx-components/compare/v9.15.1-dev...v9.15.2) (2022-11-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
## [9.15.1](https://github.com/dereekb/dbx-components/compare/v9.15.0-dev...v9.15.1) (2022-11-11)
|
|
6
10
|
|
|
7
11
|
|
package/test/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/util/test",
|
|
3
|
-
"version": "9.15.
|
|
3
|
+
"version": "9.15.2",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@dereekb/util": "9.15.
|
|
9
|
+
"@dereekb/util": "9.15.2",
|
|
10
10
|
"lodash.isequal": "^4.5.0",
|
|
11
11
|
"make-error": "^1.3.0",
|
|
12
12
|
"class-validator": "^0.13.2",
|