@wisemen/address 0.2.6 → 0.2.8
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/dist/address.builder.js +18 -9
- package/dist/address.builder.js.map +1 -1
- package/lib/address.builder.ts +18 -9
- package/package.json +6 -6
- package/.eslintcache +0 -1
package/dist/address.builder.js
CHANGED
|
@@ -3,41 +3,50 @@ export class AddressBuilder {
|
|
|
3
3
|
address;
|
|
4
4
|
constructor() {
|
|
5
5
|
this.address = new Address();
|
|
6
|
+
this.address.placeId = null;
|
|
7
|
+
this.address.placeName = null;
|
|
8
|
+
this.address.country = null;
|
|
9
|
+
this.address.city = null;
|
|
10
|
+
this.address.postalCode = null;
|
|
11
|
+
this.address.streetName = null;
|
|
12
|
+
this.address.streetNumber = null;
|
|
13
|
+
this.address.unit = null;
|
|
14
|
+
this.address.coordinates = null;
|
|
6
15
|
}
|
|
7
16
|
withPlaceName(name) {
|
|
8
|
-
this.address.placeName = name ??
|
|
17
|
+
this.address.placeName = name ?? null;
|
|
9
18
|
return this;
|
|
10
19
|
}
|
|
11
20
|
withPlaceId(id) {
|
|
12
|
-
this.address.placeId = id ??
|
|
21
|
+
this.address.placeId = id ?? null;
|
|
13
22
|
return this;
|
|
14
23
|
}
|
|
15
24
|
withCountry(country) {
|
|
16
|
-
this.address.country = country ??
|
|
25
|
+
this.address.country = country ?? null;
|
|
17
26
|
return this;
|
|
18
27
|
}
|
|
19
28
|
withCity(city) {
|
|
20
|
-
this.address.city = city ??
|
|
29
|
+
this.address.city = city ?? null;
|
|
21
30
|
return this;
|
|
22
31
|
}
|
|
23
32
|
withPostalCode(zipCode) {
|
|
24
|
-
this.address.postalCode = zipCode ??
|
|
33
|
+
this.address.postalCode = zipCode ?? null;
|
|
25
34
|
return this;
|
|
26
35
|
}
|
|
27
36
|
withStreetName(streetName) {
|
|
28
|
-
this.address.streetName = streetName ??
|
|
37
|
+
this.address.streetName = streetName ?? null;
|
|
29
38
|
return this;
|
|
30
39
|
}
|
|
31
40
|
withStreetNumber(streetNumber) {
|
|
32
|
-
this.address.streetNumber = streetNumber ??
|
|
41
|
+
this.address.streetNumber = streetNumber ?? null;
|
|
33
42
|
return this;
|
|
34
43
|
}
|
|
35
44
|
withUnit(unit) {
|
|
36
|
-
this.address.unit = unit ??
|
|
45
|
+
this.address.unit = unit ?? null;
|
|
37
46
|
return this;
|
|
38
47
|
}
|
|
39
48
|
withCoordinates(coordinates) {
|
|
40
|
-
this.address.coordinates = coordinates ??
|
|
49
|
+
this.address.coordinates = coordinates ?? null;
|
|
41
50
|
return this;
|
|
42
51
|
}
|
|
43
52
|
build() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.builder.js","sourceRoot":"","sources":["../lib/address.builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,OAAO,cAAc;IACR,OAAO,CAAS;IAEjC;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"address.builder.js","sourceRoot":"","sources":["../lib/address.builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,OAAO,cAAc;IACR,OAAO,CAAS;IAEjC;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;QAC5B,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAA;QAC3B,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,CAAA;QAC7B,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAA;QAC3B,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAA;QACxB,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAA;QAC9B,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAA;QAC9B,IAAI,CAAC,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AAW,GAAG,WAAW,IAAI,IAAI,CAAA;QAE9C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF"}
|
package/lib/address.builder.ts
CHANGED
|
@@ -6,58 +6,67 @@ export class AddressBuilder {
|
|
|
6
6
|
|
|
7
7
|
constructor () {
|
|
8
8
|
this.address = new Address()
|
|
9
|
+
this.address.placeId = null
|
|
10
|
+
this.address.placeName = null
|
|
11
|
+
this.address.country = null
|
|
12
|
+
this.address.city = null
|
|
13
|
+
this.address.postalCode = null
|
|
14
|
+
this.address.streetName = null
|
|
15
|
+
this.address.streetNumber = null
|
|
16
|
+
this.address.unit = null
|
|
17
|
+
this.address.coordinates = null
|
|
9
18
|
}
|
|
10
19
|
|
|
11
20
|
withPlaceName (name?: string | null): this {
|
|
12
|
-
this.address.placeName = name ??
|
|
21
|
+
this.address.placeName = name ?? null
|
|
13
22
|
|
|
14
23
|
return this
|
|
15
24
|
}
|
|
16
25
|
|
|
17
26
|
withPlaceId (id?: string | null): this {
|
|
18
|
-
this.address.placeId = id ??
|
|
27
|
+
this.address.placeId = id ?? null
|
|
19
28
|
|
|
20
29
|
return this
|
|
21
30
|
}
|
|
22
31
|
|
|
23
32
|
withCountry (country?: string | null): this {
|
|
24
|
-
this.address.country = country ??
|
|
33
|
+
this.address.country = country ?? null
|
|
25
34
|
|
|
26
35
|
return this
|
|
27
36
|
}
|
|
28
37
|
|
|
29
38
|
withCity (city?: string | null): this {
|
|
30
|
-
this.address.city = city ??
|
|
39
|
+
this.address.city = city ?? null
|
|
31
40
|
|
|
32
41
|
return this
|
|
33
42
|
}
|
|
34
43
|
|
|
35
44
|
withPostalCode (zipCode?: string | null): this {
|
|
36
|
-
this.address.postalCode = zipCode ??
|
|
45
|
+
this.address.postalCode = zipCode ?? null
|
|
37
46
|
|
|
38
47
|
return this
|
|
39
48
|
}
|
|
40
49
|
|
|
41
50
|
withStreetName (streetName?: string | null): this {
|
|
42
|
-
this.address.streetName = streetName ??
|
|
51
|
+
this.address.streetName = streetName ?? null
|
|
43
52
|
|
|
44
53
|
return this
|
|
45
54
|
}
|
|
46
55
|
|
|
47
56
|
withStreetNumber (streetNumber?: string | null): this {
|
|
48
|
-
this.address.streetNumber = streetNumber ??
|
|
57
|
+
this.address.streetNumber = streetNumber ?? null
|
|
49
58
|
|
|
50
59
|
return this
|
|
51
60
|
}
|
|
52
61
|
|
|
53
62
|
withUnit (unit?: string | null): this {
|
|
54
|
-
this.address.unit = unit ??
|
|
63
|
+
this.address.unit = unit ?? null
|
|
55
64
|
|
|
56
65
|
return this
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
withCoordinates (coordinates?: Coordinates | null): this {
|
|
60
|
-
this.address.coordinates = coordinates ??
|
|
69
|
+
this.address.coordinates = coordinates ?? null
|
|
61
70
|
|
|
62
71
|
return this
|
|
63
72
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wisemen/address",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js"
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
"release": "pnpx release-it"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@nestjs/common": "^11.1.
|
|
23
|
-
"@nestjs/swagger": "^11.2.
|
|
24
|
-
"@wisemen/coordinates": "0.0.
|
|
25
|
-
"@wisemen/validators": "^0.0.
|
|
22
|
+
"@nestjs/common": "^11.1.13",
|
|
23
|
+
"@nestjs/swagger": "^11.2.6",
|
|
24
|
+
"@wisemen/coordinates": "0.0.18",
|
|
25
|
+
"@wisemen/validators": "^0.0.21",
|
|
26
26
|
"class-transformer": "^0.5.1",
|
|
27
27
|
"class-validator": "^0.14.3",
|
|
28
28
|
"typeorm": "^0.3.28"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@wisemen/eslint-config-nestjs": "^0.2.
|
|
31
|
+
"@wisemen/eslint-config-nestjs": "^0.2.8",
|
|
32
32
|
"eslint": "9.39.2",
|
|
33
33
|
"eslint-plugin-import-typescript": "^0.0.4",
|
|
34
34
|
"eslint-plugin-unicorn": "62.0.0",
|
package/.eslintcache
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/eslint.config.js":"1","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-column.ts":"2","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-command.builder.ts":"3","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-command.ts":"4","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-response.ts":"5","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address.builder.ts":"6","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address.ts":"7","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/index.ts":"8","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/is-address.validator.ts":"9","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/address-column.integration.test.ts":"10","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/is-address.validator.unit.test.ts":"11","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/sql/address-test.entity.ts":"12","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/sql/datasource.ts":"13"},{"size":357,"mtime":1768820135069,"results":"14","hashOfConfig":"15"},{"size":887,"mtime":1768819954982,"results":"16","hashOfConfig":"17"},{"size":1035,"mtime":1768819954982,"results":"18","hashOfConfig":"17"},{"size":2013,"mtime":1768819804323,"results":"19","hashOfConfig":"17"},{"size":1420,"mtime":1768819804324,"results":"20","hashOfConfig":"17"},{"size":1352,"mtime":1768819954982,"results":"21","hashOfConfig":"17"},{"size":327,"mtime":1768819804324,"results":"22","hashOfConfig":"17"},{"size":411,"mtime":1768819804324,"results":"23","hashOfConfig":"17"},{"size":2949,"mtime":1768819954982,"results":"24","hashOfConfig":"17"},{"size":5341,"mtime":1768820137303,"results":"25","hashOfConfig":"26"},{"size":4618,"mtime":1768820202242,"results":"27","hashOfConfig":"26"},{"size":283,"mtime":1768820158704,"results":"28","hashOfConfig":"17"},{"size":370,"mtime":1768819804327,"results":"29","hashOfConfig":"17"},{"filePath":"30","messages":"31","suppressedMessages":"32","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"lwlkib",{"filePath":"33","messages":"34","suppressedMessages":"35","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1o8juwo",{"filePath":"36","messages":"37","suppressedMessages":"38","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","suppressedMessages":"41","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","suppressedMessages":"44","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"45","messages":"46","suppressedMessages":"47","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","suppressedMessages":"50","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"51","messages":"52","suppressedMessages":"53","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"54","messages":"55","suppressedMessages":"56","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"57","messages":"58","suppressedMessages":"59","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"x22v1o",{"filePath":"60","messages":"61","suppressedMessages":"62","errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"63","messages":"64","suppressedMessages":"65","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"66","messages":"67","suppressedMessages":"68","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/eslint.config.js",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-column.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-command.builder.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-command.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-response.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address.builder.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/index.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/is-address.validator.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/address-column.integration.test.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/is-address.validator.unit.test.ts",["69","70"],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/sql/address-test.entity.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/sql/datasource.ts",[],[],{"ruleId":"71","severity":2,"message":"72","line":137,"column":5,"nodeType":"73","messageId":"74","endLine":137,"endColumn":57},{"ruleId":"75","severity":2,"message":"76","line":137,"column":54,"nodeType":"77","messageId":"78","endLine":137,"endColumn":57,"suggestions":"79"},"@typescript-eslint/no-unsafe-assignment","Unsafe assignment of an `any` value.","AssignmentExpression","anyAssignment","@typescript-eslint/no-explicit-any","Unexpected any. Specify a different type.","TSAnyKeyword","unexpectedAny",["80","81"],{"messageId":"82","fix":"83","desc":"84"},{"messageId":"85","fix":"86","desc":"87"},"suggestUnknown",{"range":"88","text":"89"},"Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.","suggestNever",{"range":"90","text":"91"},"Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.",[4392,4395],"unknown",[4392,4395],"never"]
|