@powfix/core-js 0.27.1 → 0.28.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.
@@ -0,0 +1,244 @@
1
+ 'use strict';
2
+ function _array_like_to_array(arr, len) {
3
+ if (len == null || len > arr.length) len = arr.length;
4
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5
+ return arr2;
6
+ }
7
+ function _array_without_holes(arr) {
8
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
9
+ }
10
+ function _assert_this_initialized(self) {
11
+ if (self === void 0) {
12
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
13
+ }
14
+ return self;
15
+ }
16
+ function _call_super(_this, derived, args) {
17
+ derived = _get_prototype_of(derived);
18
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
19
+ }
20
+ function _class_call_check(instance, Constructor) {
21
+ if (!(instance instanceof Constructor)) {
22
+ throw new TypeError("Cannot call a class as a function");
23
+ }
24
+ }
25
+ function _construct(Parent, args, Class) {
26
+ if (_is_native_reflect_construct()) {
27
+ _construct = Reflect.construct;
28
+ } else {
29
+ _construct = function construct(Parent, args, Class) {
30
+ var a = [
31
+ null
32
+ ];
33
+ a.push.apply(a, args);
34
+ var Constructor = Function.bind.apply(Parent, a);
35
+ var instance = new Constructor();
36
+ if (Class) _set_prototype_of(instance, Class.prototype);
37
+ return instance;
38
+ };
39
+ }
40
+ return _construct.apply(null, arguments);
41
+ }
42
+ function _defineProperties(target, props) {
43
+ for(var i = 0; i < props.length; i++){
44
+ var descriptor = props[i];
45
+ descriptor.enumerable = descriptor.enumerable || false;
46
+ descriptor.configurable = true;
47
+ if ("value" in descriptor) descriptor.writable = true;
48
+ Object.defineProperty(target, descriptor.key, descriptor);
49
+ }
50
+ }
51
+ function _create_class(Constructor, protoProps, staticProps) {
52
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
53
+ if (staticProps) _defineProperties(Constructor, staticProps);
54
+ return Constructor;
55
+ }
56
+ function _get_prototype_of(o) {
57
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
58
+ return o.__proto__ || Object.getPrototypeOf(o);
59
+ };
60
+ return _get_prototype_of(o);
61
+ }
62
+ function _inherits(subClass, superClass) {
63
+ if (typeof superClass !== "function" && superClass !== null) {
64
+ throw new TypeError("Super expression must either be null or a function");
65
+ }
66
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
67
+ constructor: {
68
+ value: subClass,
69
+ writable: true,
70
+ configurable: true
71
+ }
72
+ });
73
+ if (superClass) _set_prototype_of(subClass, superClass);
74
+ }
75
+ function _instanceof(left, right) {
76
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
77
+ return !!right[Symbol.hasInstance](left);
78
+ } else {
79
+ return left instanceof right;
80
+ }
81
+ }
82
+ function _is_native_function(fn) {
83
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
84
+ }
85
+ function _iterable_to_array(iter) {
86
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
87
+ }
88
+ function _non_iterable_spread() {
89
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
90
+ }
91
+ function _possible_constructor_return(self, call) {
92
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
93
+ return call;
94
+ }
95
+ return _assert_this_initialized(self);
96
+ }
97
+ function _set_prototype_of(o, p) {
98
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
99
+ o.__proto__ = p;
100
+ return o;
101
+ };
102
+ return _set_prototype_of(o, p);
103
+ }
104
+ function _to_consumable_array(arr) {
105
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
106
+ }
107
+ function _type_of(obj) {
108
+ "@swc/helpers - typeof";
109
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
110
+ }
111
+ function _unsupported_iterable_to_array(o, minLen) {
112
+ if (!o) return;
113
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
114
+ var n = Object.prototype.toString.call(o).slice(8, -1);
115
+ if (n === "Object" && o.constructor) n = o.constructor.name;
116
+ if (n === "Map" || n === "Set") return Array.from(n);
117
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
118
+ }
119
+ function _wrap_native_super(Class) {
120
+ var _cache = typeof Map === "function" ? new Map() : undefined;
121
+ _wrap_native_super = function wrapNativeSuper(Class) {
122
+ if (Class === null || !_is_native_function(Class)) return Class;
123
+ if (typeof Class !== "function") {
124
+ throw new TypeError("Super expression must either be null or a function");
125
+ }
126
+ if (typeof _cache !== "undefined") {
127
+ if (_cache.has(Class)) return _cache.get(Class);
128
+ _cache.set(Class, Wrapper);
129
+ }
130
+ function Wrapper() {
131
+ return _construct(Class, arguments, _get_prototype_of(this).constructor);
132
+ }
133
+ Wrapper.prototype = Object.create(Class.prototype, {
134
+ constructor: {
135
+ value: Wrapper,
136
+ enumerable: false,
137
+ writable: true,
138
+ configurable: true
139
+ }
140
+ });
141
+ return _set_prototype_of(Wrapper, Class);
142
+ };
143
+ return _wrap_native_super(Class);
144
+ }
145
+ function _is_native_reflect_construct() {
146
+ try {
147
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
148
+ } catch (_) {}
149
+ return (_is_native_reflect_construct = function() {
150
+ return !!result;
151
+ })();
152
+ }
153
+ require('../../chunk-QHUNR4O5.cjs');
154
+ var global = require('./global');
155
+ var ClassName = /*#__PURE__*/ function(Set1) {
156
+ _inherits(ClassName, Set1);
157
+ function ClassName(input) {
158
+ _class_call_check(this, ClassName);
159
+ var _this;
160
+ _this = _call_super(this, ClassName);
161
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
162
+ try {
163
+ for(var _iterator = global.castArray(input)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
164
+ var value = _step.value;
165
+ if (value == null) {
166
+ continue;
167
+ }
168
+ if (typeof value === "string") {
169
+ if (value === "") {
170
+ continue;
171
+ }
172
+ _this.add(value);
173
+ }
174
+ }
175
+ } catch (err) {
176
+ _didIteratorError = true;
177
+ _iteratorError = err;
178
+ } finally{
179
+ try {
180
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
181
+ _iterator.return();
182
+ }
183
+ } finally{
184
+ if (_didIteratorError) {
185
+ throw _iteratorError;
186
+ }
187
+ }
188
+ }
189
+ return _this;
190
+ }
191
+ _create_class(ClassName, [
192
+ {
193
+ key: "toArray",
194
+ value: function toArray() {
195
+ return Array.from(this);
196
+ }
197
+ },
198
+ {
199
+ key: "toString",
200
+ value: function toString() {
201
+ return ClassName.format(this.toArray());
202
+ }
203
+ }
204
+ ], [
205
+ {
206
+ key: "from",
207
+ value: function from(input) {
208
+ return new this(input);
209
+ }
210
+ },
211
+ {
212
+ key: "format",
213
+ value: function format(values) {
214
+ return values.join(String.fromCharCode(32));
215
+ }
216
+ },
217
+ {
218
+ key: "toArray",
219
+ value: function toArray() {
220
+ var _this = this;
221
+ for(var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++){
222
+ inputs[_key] = arguments[_key];
223
+ }
224
+ var values = inputs.map(function(input) {
225
+ var instance = _instanceof(input, ClassName) ? input : _this.from(input);
226
+ return instance.toArray();
227
+ });
228
+ return values.flat();
229
+ }
230
+ },
231
+ {
232
+ key: "toString",
233
+ value: function toString() {
234
+ for(var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++){
235
+ inputs[_key] = arguments[_key];
236
+ }
237
+ var values = this.toArray.apply(this, _to_consumable_array(inputs));
238
+ return this.format(values);
239
+ }
240
+ }
241
+ ]);
242
+ return ClassName;
243
+ }(_wrap_native_super(Set));
244
+ exports.ClassName = ClassName;
@@ -0,0 +1,10 @@
1
+ export type ClassNameInput = (string | null | undefined) | (string | null | undefined)[];
2
+ export declare class ClassName extends Set<string> {
3
+ static from<T extends typeof ClassName>(this: T, input: ClassNameInput): InstanceType<T>;
4
+ static format(values: string[]): string;
5
+ static toArray(...inputs: (ClassName | ClassNameInput)[]): string[];
6
+ static toString(...inputs: (ClassName | ClassNameInput)[]): string;
7
+ constructor(input: ClassNameInput);
8
+ toArray(): string[];
9
+ toString(): string;
10
+ }
@@ -0,0 +1,244 @@
1
+ function _array_like_to_array(arr, len) {
2
+ if (len == null || len > arr.length) len = arr.length;
3
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
+ return arr2;
5
+ }
6
+ function _array_without_holes(arr) {
7
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
8
+ }
9
+ function _assert_this_initialized(self) {
10
+ if (self === void 0) {
11
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
12
+ }
13
+ return self;
14
+ }
15
+ function _call_super(_this, derived, args) {
16
+ derived = _get_prototype_of(derived);
17
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
18
+ }
19
+ function _class_call_check(instance, Constructor) {
20
+ if (!(instance instanceof Constructor)) {
21
+ throw new TypeError("Cannot call a class as a function");
22
+ }
23
+ }
24
+ function _construct(Parent, args, Class) {
25
+ if (_is_native_reflect_construct()) {
26
+ _construct = Reflect.construct;
27
+ } else {
28
+ _construct = function construct(Parent, args, Class) {
29
+ var a = [
30
+ null
31
+ ];
32
+ a.push.apply(a, args);
33
+ var Constructor = Function.bind.apply(Parent, a);
34
+ var instance = new Constructor();
35
+ if (Class) _set_prototype_of(instance, Class.prototype);
36
+ return instance;
37
+ };
38
+ }
39
+ return _construct.apply(null, arguments);
40
+ }
41
+ function _defineProperties(target, props) {
42
+ for(var i = 0; i < props.length; i++){
43
+ var descriptor = props[i];
44
+ descriptor.enumerable = descriptor.enumerable || false;
45
+ descriptor.configurable = true;
46
+ if ("value" in descriptor) descriptor.writable = true;
47
+ Object.defineProperty(target, descriptor.key, descriptor);
48
+ }
49
+ }
50
+ function _create_class(Constructor, protoProps, staticProps) {
51
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
52
+ if (staticProps) _defineProperties(Constructor, staticProps);
53
+ return Constructor;
54
+ }
55
+ function _get_prototype_of(o) {
56
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
57
+ return o.__proto__ || Object.getPrototypeOf(o);
58
+ };
59
+ return _get_prototype_of(o);
60
+ }
61
+ function _inherits(subClass, superClass) {
62
+ if (typeof superClass !== "function" && superClass !== null) {
63
+ throw new TypeError("Super expression must either be null or a function");
64
+ }
65
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
66
+ constructor: {
67
+ value: subClass,
68
+ writable: true,
69
+ configurable: true
70
+ }
71
+ });
72
+ if (superClass) _set_prototype_of(subClass, superClass);
73
+ }
74
+ function _instanceof(left, right) {
75
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
76
+ return !!right[Symbol.hasInstance](left);
77
+ } else {
78
+ return left instanceof right;
79
+ }
80
+ }
81
+ function _is_native_function(fn) {
82
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
83
+ }
84
+ function _iterable_to_array(iter) {
85
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
86
+ }
87
+ function _non_iterable_spread() {
88
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
89
+ }
90
+ function _possible_constructor_return(self, call) {
91
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
92
+ return call;
93
+ }
94
+ return _assert_this_initialized(self);
95
+ }
96
+ function _set_prototype_of(o, p) {
97
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
98
+ o.__proto__ = p;
99
+ return o;
100
+ };
101
+ return _set_prototype_of(o, p);
102
+ }
103
+ function _to_consumable_array(arr) {
104
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
105
+ }
106
+ function _type_of(obj) {
107
+ "@swc/helpers - typeof";
108
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
109
+ }
110
+ function _unsupported_iterable_to_array(o, minLen) {
111
+ if (!o) return;
112
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
113
+ var n = Object.prototype.toString.call(o).slice(8, -1);
114
+ if (n === "Object" && o.constructor) n = o.constructor.name;
115
+ if (n === "Map" || n === "Set") return Array.from(n);
116
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
117
+ }
118
+ function _wrap_native_super(Class) {
119
+ var _cache = typeof Map === "function" ? new Map() : undefined;
120
+ _wrap_native_super = function wrapNativeSuper(Class) {
121
+ if (Class === null || !_is_native_function(Class)) return Class;
122
+ if (typeof Class !== "function") {
123
+ throw new TypeError("Super expression must either be null or a function");
124
+ }
125
+ if (typeof _cache !== "undefined") {
126
+ if (_cache.has(Class)) return _cache.get(Class);
127
+ _cache.set(Class, Wrapper);
128
+ }
129
+ function Wrapper() {
130
+ return _construct(Class, arguments, _get_prototype_of(this).constructor);
131
+ }
132
+ Wrapper.prototype = Object.create(Class.prototype, {
133
+ constructor: {
134
+ value: Wrapper,
135
+ enumerable: false,
136
+ writable: true,
137
+ configurable: true
138
+ }
139
+ });
140
+ return _set_prototype_of(Wrapper, Class);
141
+ };
142
+ return _wrap_native_super(Class);
143
+ }
144
+ function _is_native_reflect_construct() {
145
+ try {
146
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
147
+ } catch (_) {}
148
+ return (_is_native_reflect_construct = function() {
149
+ return !!result;
150
+ })();
151
+ }
152
+ import '../../chunk-S7EYY36U.js';
153
+ import { castArray } from './global/index.js';
154
+ var ClassName = /*#__PURE__*/ function(Set1) {
155
+ "use strict";
156
+ _inherits(ClassName, Set1);
157
+ function ClassName(input) {
158
+ _class_call_check(this, ClassName);
159
+ var _this;
160
+ _this = _call_super(this, ClassName);
161
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
162
+ try {
163
+ for(var _iterator = castArray(input)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
164
+ var value = _step.value;
165
+ if (value == null) {
166
+ continue;
167
+ }
168
+ if (typeof value === "string") {
169
+ if (value === "") {
170
+ continue;
171
+ }
172
+ _this.add(value);
173
+ }
174
+ }
175
+ } catch (err) {
176
+ _didIteratorError = true;
177
+ _iteratorError = err;
178
+ } finally{
179
+ try {
180
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
181
+ _iterator.return();
182
+ }
183
+ } finally{
184
+ if (_didIteratorError) {
185
+ throw _iteratorError;
186
+ }
187
+ }
188
+ }
189
+ return _this;
190
+ }
191
+ _create_class(ClassName, [
192
+ {
193
+ key: "toArray",
194
+ value: function toArray() {
195
+ return Array.from(this);
196
+ }
197
+ },
198
+ {
199
+ key: "toString",
200
+ value: function toString() {
201
+ return ClassName.format(this.toArray());
202
+ }
203
+ }
204
+ ], [
205
+ {
206
+ key: "from",
207
+ value: function from(input) {
208
+ return new this(input);
209
+ }
210
+ },
211
+ {
212
+ key: "format",
213
+ value: function format(values) {
214
+ return values.join(String.fromCharCode(32));
215
+ }
216
+ },
217
+ {
218
+ key: "toArray",
219
+ value: function toArray() {
220
+ var _this = this;
221
+ for(var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++){
222
+ inputs[_key] = arguments[_key];
223
+ }
224
+ var values = inputs.map(function(input) {
225
+ var instance = _instanceof(input, ClassName) ? input : _this.from(input);
226
+ return instance.toArray();
227
+ });
228
+ return values.flat();
229
+ }
230
+ },
231
+ {
232
+ key: "toString",
233
+ value: function toString() {
234
+ for(var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++){
235
+ inputs[_key] = arguments[_key];
236
+ }
237
+ var values = this.toArray.apply(this, _to_consumable_array(inputs));
238
+ return this.format(values);
239
+ }
240
+ }
241
+ ]);
242
+ return ClassName;
243
+ }(_wrap_native_super(Set));
244
+ export { ClassName };
@@ -7,6 +7,7 @@ var Uint8ArrayUtils = require('./Uint8ArrayUtils');
7
7
  var UuidUtils = require('./UuidUtils');
8
8
  var BooleanUtils = require('./BooleanUtils');
9
9
  var Calc = require('./Calc');
10
+ var ClassName = require('./ClassName');
10
11
  var CoordinateUtils = require('./CoordinateUtils');
11
12
  var CyclicCounter = require('./CyclicCounter');
12
13
  var DateUtils = require('./DateUtils');
@@ -85,6 +86,14 @@ Object.keys(Calc).forEach(function(k) {
85
86
  }
86
87
  });
87
88
  });
89
+ Object.keys(ClassName).forEach(function(k) {
90
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
91
+ enumerable: true,
92
+ get: function get() {
93
+ return ClassName[k];
94
+ }
95
+ });
96
+ });
88
97
  Object.keys(CoordinateUtils).forEach(function(k) {
89
98
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
90
99
  enumerable: true,
@@ -6,6 +6,7 @@ export * from './Uint8ArrayUtils.js';
6
6
  export * from './UuidUtils.js';
7
7
  export * from './BooleanUtils.js';
8
8
  export * from './Calc.js';
9
+ export * from './ClassName.js';
9
10
  export * from './CoordinateUtils.js';
10
11
  export * from "./CyclicCounter.js";
11
12
  export * from './DateUtils.js';
@@ -6,6 +6,7 @@ export * from './Uint8ArrayUtils.js';
6
6
  export * from './UuidUtils.js';
7
7
  export * from './BooleanUtils.js';
8
8
  export * from './Calc.js';
9
+ export * from './ClassName.js';
9
10
  export * from './CoordinateUtils.js';
10
11
  export * from './CyclicCounter.js';
11
12
  export * from './DateUtils.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powfix/core-js",
3
- "version": "0.27.1",
3
+ "version": "0.28.2",
4
4
  "description": "core package",
5
5
  "author": "Kwon Kyung-Min <powfix@gmail.com>",
6
6
  "private": false,