@ptolemy2002/rgx 2.3.2 → 2.4.0
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/README.md +2 -0
- package/dist/collection.d.ts +1 -0
- package/dist/collection.js +3 -1
- package/dist/internal/createConstructFunction.d.ts +2 -0
- package/dist/internal/createConstructFunction.js +6 -0
- package/dist/internal/index.d.ts +1 -0
- package/dist/internal/index.js +17 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -98,6 +98,8 @@ constructor(message: string, got: string)
|
|
|
98
98
|
### RGXTokenCollection
|
|
99
99
|
A class representing a collection of RGX tokens. This is not used internally, but may be useful for users who want to easily manage collections of RGX tokens like an array, but with additional metadata about the collection mode (union or concat).
|
|
100
100
|
|
|
101
|
+
A function `rgxTokenCollection` is provided with the same parameters as this class' constructor, for easier instantiation without needing to use the `new` keyword.
|
|
102
|
+
|
|
101
103
|
#### Constructor
|
|
102
104
|
```typescript
|
|
103
105
|
constructor(tokens: RGXToken[] = [], mode: RGXTokenCollectionMode = 'concat')
|
package/dist/collection.d.ts
CHANGED
|
@@ -42,3 +42,4 @@ export declare class RGXTokenCollection implements Collection<RGXToken> {
|
|
|
42
42
|
keys(): IterableIterator<number>;
|
|
43
43
|
values(): IterableIterator<RGXToken>;
|
|
44
44
|
}
|
|
45
|
+
export declare const rgxTokenCollection: (tokens?: RGXToken[] | undefined, mode?: RGXTokenCollectionMode | undefined) => RGXTokenCollection;
|
package/dist/collection.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RGXTokenCollection = void 0;
|
|
3
|
+
exports.rgxTokenCollection = exports.RGXTokenCollection = void 0;
|
|
4
4
|
const index_1 = require("./index");
|
|
5
5
|
const immutability_utils_1 = require("@ptolemy2002/immutability-utils");
|
|
6
|
+
const internal_1 = require("./internal");
|
|
6
7
|
class RGXTokenCollection {
|
|
7
8
|
constructor(tokens = [], mode = 'concat') {
|
|
8
9
|
this.tokens = [];
|
|
@@ -150,3 +151,4 @@ class RGXTokenCollection {
|
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
153
|
exports.RGXTokenCollection = RGXTokenCollection;
|
|
154
|
+
exports.rgxTokenCollection = (0, internal_1.createConstructFunction)(RGXTokenCollection);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./createConstructFunction";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./createConstructFunction"), exports);
|