@alanszp/core 1.8.0 → 4.0.5

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/assignKey.js CHANGED
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.assignKeys = exports.assignKey = void 0;
4
4
  function assignKey(target, source, key, defaultValue) {
5
- if (source[key]) {
5
+ if (source[key] !== undefined) {
6
6
  target[key] = source[key];
7
7
  return;
8
8
  }
9
- if (defaultValue) {
9
+ if (defaultValue !== undefined) {
10
10
  target[key] = defaultValue;
11
11
  }
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"assignKey.js","sourceRoot":"","sources":["../src/assignKey.ts"],"names":[],"mappings":";;;AAAA,SAAgB,SAAS,CACvB,MAAuB,EACvB,MAAuB,EACvB,GAAQ,EACR,YAAmC;IAEnC,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE;QACf,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,OAAO;KACR;IAED,IAAI,YAAY,EAAE;QAChB,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC;KAC5B;AACH,CAAC;AAdD,8BAcC;AAED,SAAgB,UAAU,CACxB,MAAuB,EACvB,MAAuB,EACvB,IAA+B;IAE/B,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC;AARD,gCAQC"}
1
+ {"version":3,"file":"assignKey.js","sourceRoot":"","sources":["../src/assignKey.ts"],"names":[],"mappings":";;;AAAA,SAAgB,SAAS,CACvB,MAAuB,EACvB,MAAuB,EACvB,GAAQ,EACR,YAAmC;IAEnC,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;QAC7B,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,OAAO;KACR;IAED,IAAI,YAAY,KAAK,SAAS,EAAE;QAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC;KAC5B;AACH,CAAC;AAdD,8BAcC;AAED,SAAgB,UAAU,CACxB,MAAuB,EACvB,MAAuB,EACvB,IAA+B;IAE/B,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC;AARD,gCAQC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alanszp/core",
3
- "version": "1.8.0",
3
+ "version": "4.0.5",
4
4
  "description": "Alan's core TS/JS lib.",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -15,7 +15,8 @@
15
15
  "compile": "rm -rf ./dist && tsc --declaration",
16
16
  "compile-watch": "tsc -w",
17
17
  "build": "yarn run compile",
18
- "prepack": "yarn run build"
18
+ "prepack": "yarn run build",
19
+ "yalc-publish": "yarn run yalc publish"
19
20
  },
20
- "gitHead": "9770c97b5ff64d72f1d4117196077a66421bbc55"
21
+ "gitHead": "dd71920ed2c565d81bab8de3fafadbea0fff9ad9"
21
22
  }
package/src/assignKey.ts CHANGED
@@ -4,12 +4,12 @@ export function assignKey<CommonInterface, Key extends keyof CommonInterface>(
4
4
  key: Key,
5
5
  defaultValue?: CommonInterface[Key]
6
6
  ): void {
7
- if (source[key]) {
7
+ if (source[key] !== undefined) {
8
8
  target[key] = source[key];
9
9
  return;
10
10
  }
11
11
 
12
- if (defaultValue) {
12
+ if (defaultValue !== undefined) {
13
13
  target[key] = defaultValue;
14
14
  }
15
15
  }