@powfix/core-js 0.23.8 → 0.23.9

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.
@@ -81,6 +81,7 @@ var chunkETV4XYOV_cjs = require('../../../chunk-ETV4XYOV.cjs');
81
81
  var sequelize = require('sequelize');
82
82
  var constants = require('../../../shared/constants');
83
83
  var node = require('@powfix/uuid/node');
84
+ var shared = require('../../../shared');
84
85
  var _SequelizeUtils = /*#__PURE__*/ function() {
85
86
  function _SequelizeUtils() {
86
87
  _class_call_check(this, _SequelizeUtils);
@@ -105,31 +106,19 @@ var _SequelizeUtils = /*#__PURE__*/ function() {
105
106
  var columnName = options.columnName, overrideOptions = _object_without_properties(options, [
106
107
  "columnName"
107
108
  ]);
108
- if (overrideOptions.allowNull) {
109
- return _object_spread({
110
- type: "binary(16)",
111
- get: function get() {
112
- var value = this.getDataValue(columnName);
113
- return value != null ? node.UUID.from(value) : value;
114
- },
115
- set: function set(input) {
116
- var value = input != null ? node.UUID.from(input).toBuffer() : input;
117
- this.setDataValue(columnName, value);
118
- }
119
- }, overrideOptions);
120
- } else {
121
- return _object_spread({
122
- type: "binary(16)",
123
- get: function get() {
124
- var value = this.getDataValue(columnName);
109
+ return _object_spread({
110
+ type: "binary(16)",
111
+ get: function get() {
112
+ return shared.mapIfNotNullish(this.getDataValue(columnName), function(value) {
125
113
  return node.UUID.from(value);
126
- },
127
- set: function set(input) {
128
- var value = node.UUID.from(input).toBuffer();
129
- this.setDataValue(columnName, value);
130
- }
131
- }, overrideOptions);
132
- }
114
+ });
115
+ },
116
+ set: function set(value) {
117
+ this.setDataValue(columnName, shared.mapIfNotNullish(value, function(e) {
118
+ return node.UUID.from(e).toBuffer();
119
+ }));
120
+ }
121
+ }, overrideOptions);
133
122
  }
134
123
  },
135
124
  {
@@ -80,6 +80,7 @@ import { __publicField } from '../../../chunk-PKBMQBKP.js';
80
80
  import { Op } from 'sequelize';
81
81
  import { NOT_NULL } from '../../../shared/constants/index.js';
82
82
  import { UUID } from '@powfix/uuid/node';
83
+ import { mapIfNotNullish } from '../../../shared/index.js';
83
84
  var _SequelizeUtils = /*#__PURE__*/ function() {
84
85
  "use strict";
85
86
  function _SequelizeUtils() {
@@ -105,31 +106,19 @@ var _SequelizeUtils = /*#__PURE__*/ function() {
105
106
  var columnName = options.columnName, overrideOptions = _object_without_properties(options, [
106
107
  "columnName"
107
108
  ]);
108
- if (overrideOptions.allowNull) {
109
- return _object_spread({
110
- type: "binary(16)",
111
- get: function get() {
112
- var value = this.getDataValue(columnName);
113
- return value != null ? UUID.from(value) : value;
114
- },
115
- set: function set(input) {
116
- var value = input != null ? UUID.from(input).toBuffer() : input;
117
- this.setDataValue(columnName, value);
118
- }
119
- }, overrideOptions);
120
- } else {
121
- return _object_spread({
122
- type: "binary(16)",
123
- get: function get() {
124
- var value = this.getDataValue(columnName);
109
+ return _object_spread({
110
+ type: "binary(16)",
111
+ get: function get() {
112
+ return mapIfNotNullish(this.getDataValue(columnName), function(value) {
125
113
  return UUID.from(value);
126
- },
127
- set: function set(input) {
128
- var value = UUID.from(input).toBuffer();
129
- this.setDataValue(columnName, value);
130
- }
131
- }, overrideOptions);
132
- }
114
+ });
115
+ },
116
+ set: function set(value) {
117
+ this.setDataValue(columnName, mapIfNotNullish(value, function(e) {
118
+ return UUID.from(e).toBuffer();
119
+ }));
120
+ }
121
+ }, overrideOptions);
133
122
  }
134
123
  },
135
124
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powfix/core-js",
3
- "version": "0.23.8",
3
+ "version": "0.23.9",
4
4
  "description": "core package",
5
5
  "author": "Kwon Kyung-Min <powfix@gmail.com>",
6
6
  "private": false,
@@ -23,9 +23,9 @@
23
23
  "clean": "rm -rf dist | wc -l",
24
24
  "esmfix": "tsc-esm-fix --ext='.js' dist/**/*.js",
25
25
  "compile": "tsc",
26
+ "bundle": "tsup --config tsup.config.ts",
26
27
  "prebuild": "yarn clean",
27
- "build": "yarn compile && yarn build:tsup && yarn build:dts",
28
- "build:tsup": "tsup --config tsup.config.ts",
28
+ "build": "yarn compile && yarn bundle && yarn build:dts",
29
29
  "build:dts": "tsc -p tsconfig.declaration.json",
30
30
  "postbuild": "yarn esmfix"
31
31
  },
@@ -62,7 +62,7 @@
62
62
  "uuid": "9.0.1"
63
63
  },
64
64
  "devDependencies": {
65
- "@powfix/uuid": "^0.2.7",
65
+ "@powfix/uuid": "^0.2.12",
66
66
  "@swc/core": "^1.13.5",
67
67
  "@types/base-64": "1.0.2",
68
68
  "@types/node": "^24.5.1",