detritus-utils 0.5.0-beta.4 → 0.5.0-beta.6

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.
@@ -31,12 +31,17 @@ export declare class BaseCollection<K, V> extends BaseCollectionMixin<K, V> {
31
31
  readonly cache: Map<K, V>;
32
32
  _lastUsed?: Map<K, number>;
33
33
  _order?: Map<K, true>;
34
- expire?: number;
34
+ _intervalTime: number;
35
+ readonly expire?: number;
35
36
  interval?: Timers.Interval;
36
- intervalTime: number;
37
+ readonly intervalTime: number;
37
38
  limit: number;
38
39
  constructor({ expire, intervalTime, limit }?: BaseCollectionOptions);
39
40
  get lastUsed(): Map<K, number>;
41
+ /**
42
+ * If the item outlived `expire` but the interval hasn't swept it yet
43
+ */
44
+ _hasExpired(key: K): boolean;
40
45
  touch(key: K): void;
41
46
  get shouldStartInterval(): boolean;
42
47
  setExpire(value: number): this;
@@ -90,8 +90,17 @@ class BaseCollectionMixin {
90
90
  return map;
91
91
  }
92
92
  reduce(func, initialValue) {
93
+ const values = this.values();
93
94
  let reduced = initialValue;
94
- for (let [key, value] of this) {
95
+ // like `Array.prototype.reduce`, with no initial value the first item is the starting one
96
+ if (arguments.length < 2) {
97
+ const first = values.next();
98
+ if (first.done) {
99
+ throw new TypeError('Reduce of empty collection with no initial value');
100
+ }
101
+ reduced = first.value;
102
+ }
103
+ for (let value of values) {
95
104
  reduced = func(reduced, value);
96
105
  }
97
106
  return reduced;
@@ -127,9 +136,14 @@ class BaseCollectionMixin {
127
136
  }
128
137
  }
129
138
  exports.BaseCollectionMixin = BaseCollectionMixin;
139
+ // a `NaN` limit would never be satisfied and evict everything on each insert
140
+ function normalizeLimit(value) {
141
+ return (value === undefined || value === null || Number.isNaN(value)) ? Infinity : value;
142
+ }
130
143
  class BaseCollection extends BaseCollectionMixin {
131
144
  cache = new Map();
132
145
  _lastUsed;
146
+ // read only, use `setExpire()` and `setIntervalTimeout()` to change them
133
147
  expire;
134
148
  interval = undefined;
135
149
  intervalTime = 5000;
@@ -142,13 +156,15 @@ class BaseCollection extends BaseCollectionMixin {
142
156
  if (intervalTime !== undefined) {
143
157
  this.intervalTime = intervalTime;
144
158
  }
159
+ this._intervalTime = this.intervalTime;
145
160
  if (limit !== undefined) {
146
- this.limit = limit;
161
+ this.limit = normalizeLimit(limit);
147
162
  }
148
163
  if (this.expire) {
149
164
  this.intervalTime = Math.min(this.expire, this.intervalTime);
150
165
  }
151
166
  Object.defineProperties(this, {
167
+ _intervalTime: { enumerable: false, writable: true },
152
168
  _lastUsed: { enumerable: false, writable: true },
153
169
  _order: { enumerable: false, writable: true },
154
170
  cache: { enumerable: false },
@@ -167,6 +183,16 @@ class BaseCollection extends BaseCollectionMixin {
167
183
  }
168
184
  return new Map();
169
185
  }
186
+ /**
187
+ * If the item outlived `expire` but the interval hasn't swept it yet
188
+ */
189
+ _hasExpired(key) {
190
+ if (this.expire && this._lastUsed) {
191
+ const lastUsed = this._lastUsed.get(key);
192
+ return lastUsed !== undefined && this.expire < Date.now() - lastUsed;
193
+ }
194
+ return false;
195
+ }
170
196
  touch(key) {
171
197
  const lastUsed = this.lastUsed;
172
198
  lastUsed.delete(key);
@@ -179,7 +205,8 @@ class BaseCollection extends BaseCollectionMixin {
179
205
  const wasExpiring = !!this.expire;
180
206
  Object.defineProperty(this, 'expire', { value });
181
207
  if (value) {
182
- Object.defineProperty(this, 'intervalTime', { value: Math.min(value, this.intervalTime) });
208
+ // based on the asked for interval, so raising `expire` again doesn't keep a tiny interval from a smaller one
209
+ Object.defineProperty(this, 'intervalTime', { value: Math.min(value, this._intervalTime) });
183
210
  const now = Date.now();
184
211
  const lastUsed = this.lastUsed;
185
212
  for (let key of this.cache.keys()) {
@@ -192,6 +219,7 @@ class BaseCollection extends BaseCollectionMixin {
192
219
  }
193
220
  }
194
221
  else {
222
+ Object.defineProperty(this, 'intervalTime', { value: this._intervalTime });
195
223
  this.stopInterval();
196
224
  if (this._lastUsed) {
197
225
  this._lastUsed.clear();
@@ -200,11 +228,12 @@ class BaseCollection extends BaseCollectionMixin {
200
228
  return this;
201
229
  }
202
230
  setLimit(value) {
203
- this.limit = value;
231
+ this.limit = normalizeLimit(value);
204
232
  this.evict(0);
205
233
  return this;
206
234
  }
207
235
  setIntervalTimeout(value) {
236
+ this._intervalTime = value;
208
237
  Object.defineProperty(this, 'intervalTime', { value });
209
238
  if (value) {
210
239
  if (this.size) {
@@ -242,10 +271,10 @@ class BaseCollection extends BaseCollectionMixin {
242
271
  }
243
272
  }
244
273
  stopInterval() {
274
+ // keep the interval object around so an `unref()` on it still applies the next time it starts
245
275
  if (this.interval) {
246
276
  this.interval.stop();
247
277
  }
248
- this.interval = undefined;
249
278
  }
250
279
  get size() {
251
280
  return this.cache.size;
@@ -267,6 +296,10 @@ class BaseCollection extends BaseCollectionMixin {
267
296
  for (let key of keys) {
268
297
  collection.set(key, this.cache.get(key));
269
298
  }
299
+ if (collection.expire && this._lastUsed) {
300
+ // `set` stamped every item as just used, keep their real ages (the map is already oldest first)
301
+ collection._lastUsed = new Map(this._lastUsed);
302
+ }
270
303
  return collection;
271
304
  }
272
305
  delete(key) {
@@ -288,6 +321,11 @@ class BaseCollection extends BaseCollectionMixin {
288
321
  get(key) {
289
322
  const value = this.cache.get(key);
290
323
  if ((this.limit !== Infinity || this.expire) && (value !== undefined || this.cache.has(key))) {
324
+ if (this._hasExpired(key)) {
325
+ // the interval just hasn't swept it yet, don't hand it out (or refresh it) past its expiry
326
+ this.delete(key);
327
+ return undefined;
328
+ }
291
329
  if (this.limit !== Infinity) {
292
330
  // mark it as the most recently used
293
331
  const order = this.getOrder();
@@ -301,21 +339,27 @@ class BaseCollection extends BaseCollectionMixin {
301
339
  return value;
302
340
  }
303
341
  getOrInsert(key, defaultValue) {
304
- if (this.has(key)) {
305
- return this.get(key);
342
+ const value = this.get(key);
343
+ if (value !== undefined || this.cache.has(key)) {
344
+ return value;
306
345
  }
307
346
  this.set(key, defaultValue);
308
347
  return defaultValue;
309
348
  }
310
349
  getOrInsertComputed(key, func) {
311
- if (this.has(key)) {
312
- return this.get(key);
350
+ const value = this.get(key);
351
+ if (value !== undefined || this.cache.has(key)) {
352
+ return value;
313
353
  }
314
- const value = func(key);
315
- this.set(key, value);
316
- return value;
354
+ const computed = func(key);
355
+ this.set(key, computed);
356
+ return computed;
317
357
  }
318
358
  has(key) {
359
+ if (this._hasExpired(key)) {
360
+ this.delete(key);
361
+ return false;
362
+ }
319
363
  return this.cache.has(key);
320
364
  }
321
365
  keys() {
package/lib/baseset.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  export declare class BaseSet<V> extends Set<V> {
2
2
  get length(): number;
3
3
  clone(): BaseSet<V>;
4
- every(func: any): boolean;
4
+ every(func: (v: V) => boolean): boolean;
5
5
  filter(func: (v: V) => boolean): Array<V>;
6
6
  find(func: (v: V) => boolean): undefined | V;
7
7
  first(): undefined | V;
8
8
  join(separator?: string): string;
9
9
  map(func: (v: V) => any): Array<any>;
10
- reduce(cb: any, initialValue?: any): any;
10
+ reduce(cb: (accumulator: any, v: V) => any, initialValue?: any): any;
11
11
  some(func: (v: V) => boolean): boolean;
12
12
  sort(func?: (x: V, y: V) => number): Array<V>;
13
13
  toArray(): Array<V>;
package/lib/baseset.js CHANGED
@@ -9,7 +9,12 @@ class BaseSet extends Set {
9
9
  return new BaseSet(this.values());
10
10
  }
11
11
  every(func) {
12
- return this.toArray().every(func);
12
+ for (let value of this) {
13
+ if (!func(value)) {
14
+ return false;
15
+ }
16
+ }
17
+ return true;
13
18
  }
14
19
  filter(func) {
15
20
  const map = [];
@@ -41,7 +46,20 @@ class BaseSet extends Set {
41
46
  return map;
42
47
  }
43
48
  reduce(cb, initialValue) {
44
- return this.toArray().reduce(cb, initialValue);
49
+ const values = this.values();
50
+ let reduced = initialValue;
51
+ // like `Array.prototype.reduce`, with no initial value the first item is the starting one
52
+ if (arguments.length < 2) {
53
+ const first = values.next();
54
+ if (first.done) {
55
+ throw new TypeError('Reduce of empty set with no initial value');
56
+ }
57
+ reduced = first.value;
58
+ }
59
+ for (let value of values) {
60
+ reduced = cb(reduced, value);
61
+ }
62
+ return reduced;
45
63
  }
46
64
  some(func) {
47
65
  for (let value of this) {
@@ -1,6 +1,6 @@
1
1
  export declare const Package: Readonly<{
2
2
  URL: "https://github.com/detritusjs/utils";
3
- VERSION: "0.5.0-beta.4";
3
+ VERSION: string;
4
4
  }>;
5
5
  export declare const DISCORD_SNOWFLAKE_EPOCH = 1420070400000;
6
6
  export declare const DISCORD_TOKEN_EPOCH = 1293840000000;
package/lib/constants.js CHANGED
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DISCORD_TOKEN_EPOCH = exports.DISCORD_SNOWFLAKE_EPOCH = exports.Package = void 0;
4
+ // package.json is in every published package and sits one folder up from both src/ and lib/, `require` keeps tsc
5
+ // from pulling it into the build (it's outside rootDir)
6
+ const { version } = require('../package.json');
4
7
  exports.Package = Object.freeze({
5
8
  URL: 'https://github.com/detritusjs/utils',
6
- VERSION: '0.5.0-beta.4',
9
+ VERSION: version,
7
10
  });
8
11
  exports.DISCORD_SNOWFLAKE_EPOCH = 1420070400000;
9
12
  exports.DISCORD_TOKEN_EPOCH = 1293840000000;
@@ -1,6 +1,5 @@
1
1
  import { EventEmitter } from 'events';
2
- declare let Emitter: typeof EventEmitter;
3
- export declare class EventSpewer extends Emitter implements EventEmitter {
2
+ export declare class EventSpewer extends EventEmitter {
4
3
  /**
5
4
  * @ignore
6
5
  */
@@ -25,7 +24,11 @@ export declare class EventSubscription {
25
24
  listener: ((...args: any[]) => void) | null;
26
25
  name: string | symbol;
27
26
  spewer: EventSpewer | null;
27
+ /**
28
+ * What's actually attached to the spewer, a function only this subscription owns
29
+ * Removing it can't remove another registration of `listener` (or bring one back)
30
+ */
31
+ wrapped: ((...args: any[]) => void) | null;
28
32
  constructor(spewer: EventSpewer, name: string | symbol, listener: (...args: any[]) => void);
29
33
  remove(): void;
30
34
  }
31
- export {};
@@ -2,12 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EventSubscription = exports.EventSpewer = void 0;
4
4
  const events_1 = require("events");
5
- let Emitter = events_1.EventEmitter;
6
- try {
7
- Emitter = require('eventemitter3');
8
- }
9
- catch (e) { }
10
- class EventSpewer extends Emitter {
5
+ class EventSpewer extends events_1.EventEmitter {
11
6
  /**
12
7
  * @ignore
13
8
  */
@@ -26,7 +21,7 @@ class EventSpewer extends Emitter {
26
21
  }
27
22
  subscribe(name, listener) {
28
23
  const subscription = new EventSubscription(this, name, listener);
29
- this.on(name, listener);
24
+ this.on(name, subscription.wrapped);
30
25
  if (!this._subscriptions) {
31
26
  this._subscriptions = new Map();
32
27
  }
@@ -56,33 +51,27 @@ class EventSpewer extends Emitter {
56
51
  this._deleteSubscriptions(subscription.name, subscriptions);
57
52
  }
58
53
  }
59
- if (subscription.listener) {
60
- const { listener, name } = subscription;
61
- const count = () => this.listeners(name).filter((x) => x === listener).length;
62
- const before = count();
63
- super.removeListener.call(this, name, listener);
64
- for (let attached = count(); attached < before - 1; attached++) {
65
- super.on.call(this, name, listener);
66
- }
54
+ if (subscription.wrapped) {
55
+ // the wrapper is only ever attached by this subscription, so this can't take out another registration of the
56
+ // same function (like a `once()`, which `removeListener(name, listener)` would remove first)
57
+ super.removeListener.call(this, subscription.name, subscription.wrapped);
67
58
  }
68
59
  }
69
60
  removeListener(name, listener, ...args) {
70
61
  super.removeListener.call(this, name, listener, ...args);
71
62
  if (this._subscriptions) {
72
63
  const subscriptions = this._subscriptions.get(name);
73
- if (subscriptions && subscriptions.some((subscription) => subscription.listener === listener)) {
74
- let attached = this.listeners(name).filter((x) => x === listener).length;
64
+ // `listener` is either the subscribed function or a subscription's wrapper (when node removes it, like in `removeAllListeners()`)
65
+ if (subscriptions && subscriptions.some((subscription) => subscription.listener === listener || subscription.wrapped === listener)) {
66
+ // drop the subscriptions whose wrapper isn't attached anymore
67
+ const attached = new Set(this.rawListeners(name));
75
68
  for (let i = subscriptions.length - 1; 0 <= i; i--) {
76
69
  const subscription = subscriptions[i];
77
- if (subscription.listener === listener) {
78
- if (attached) {
79
- attached--;
80
- }
81
- else {
82
- subscriptions.splice(i, 1);
83
- subscription.listener = null;
84
- subscription.spewer = null;
85
- }
70
+ if (!attached.has(subscription.wrapped)) {
71
+ subscriptions.splice(i, 1);
72
+ subscription.listener = null;
73
+ subscription.spewer = null;
74
+ subscription.wrapped = null;
86
75
  }
87
76
  }
88
77
  this._deleteSubscriptions(name, subscriptions);
@@ -108,6 +97,7 @@ class EventSpewer extends Emitter {
108
97
  for (let subscription of subscriptions) {
109
98
  subscription.listener = null;
110
99
  subscription.spewer = null;
100
+ subscription.wrapped = null;
111
101
  }
112
102
  }
113
103
  this._subscriptions = undefined;
@@ -140,10 +130,22 @@ class EventSubscription {
140
130
  listener;
141
131
  name;
142
132
  spewer;
133
+ /**
134
+ * What's actually attached to the spewer, a function only this subscription owns
135
+ * Removing it can't remove another registration of `listener` (or bring one back)
136
+ */
137
+ wrapped;
143
138
  constructor(spewer, name, listener) {
144
139
  this.name = name;
145
140
  this.listener = listener;
146
141
  this.spewer = spewer;
142
+ const wrapped = function (...args) {
143
+ return listener.apply(this, args);
144
+ };
145
+ // the same trick node uses for `once()`, so `listeners()`, `listenerCount(name, listener)` and
146
+ // `removeListener(name, listener)` still see the original function
147
+ wrapped.listener = listener;
148
+ this.wrapped = wrapped;
147
149
  }
148
150
  remove() {
149
151
  if (this.spewer) {
@@ -151,6 +153,7 @@ class EventSubscription {
151
153
  }
152
154
  this.listener = null;
153
155
  this.spewer = null;
156
+ this.wrapped = null;
154
157
  }
155
158
  }
156
159
  exports.EventSubscription = EventSubscription;
package/lib/snowflake.js CHANGED
@@ -22,30 +22,56 @@ const max = Object.freeze({
22
22
  sequence: -1n ^ (-1n << bits.sequence),
23
23
  workerId: -1n ^ (-1n << bits.workerId),
24
24
  });
25
+ // the last generated millisecond (absolute, not relative to an epoch) and the sequence used in it
25
26
  const cache = {
26
27
  sequence: 0n,
28
+ timestamp: -1n,
27
29
  };
28
30
  const DEFAULT_EPOCH = BigInt(constants_1.DISCORD_SNOWFLAKE_EPOCH);
31
+ const MAX_ID = 1n << 64n;
29
32
  function getEpoch(epoch) {
30
33
  return (epoch === undefined || epoch === null) ? DEFAULT_EPOCH : BigInt(epoch);
31
34
  }
35
+ function parseId(id) {
36
+ const snowflake = BigInt(id);
37
+ // snowflakes are unsigned 64 bit, anything outside of that would decode into garbage
38
+ if (snowflake < 0n || MAX_ID <= snowflake) {
39
+ throw new RangeError(`Snowflake ${id} is not an unsigned 64 bit integer`);
40
+ }
41
+ return snowflake;
42
+ }
32
43
  function generate(options = {}) {
33
44
  const epoch = getEpoch(options.epoch);
34
45
  const processId = BigInt(options.processId ?? 0) & max.processId;
35
- const now = options.timestamp ?? Date.now();
36
- const elapsed = BigInt(now) - epoch;
37
- if (elapsed < 0n) {
46
+ let now = BigInt(options.timestamp ?? Date.now());
47
+ if (now < epoch) {
38
48
  throw new RangeError(`Timestamp ${now} is before the epoch ${epoch}`);
39
49
  }
40
- const timestamp = elapsed % max.timestamp;
41
50
  const workerId = BigInt(options.workerId ?? 0) & max.workerId;
42
51
  let sequence;
43
52
  if (options.sequence === undefined || options.sequence === null) {
44
- sequence = cache.sequence = ++cache.sequence & max.sequence;
53
+ // the sequence only counts within one millisecond, so ids stay unique until 4096 are made in the same one
54
+ if ((options.timestamp === undefined || options.timestamp === null) && now < cache.timestamp) {
55
+ // the clock went backwards (or the last millisecond ran out of sequences), keep counting from the last one
56
+ now = cache.timestamp;
57
+ }
58
+ if (now === cache.timestamp) {
59
+ sequence = (cache.sequence + 1n) & max.sequence;
60
+ if (!sequence) {
61
+ // every sequence in this millisecond is used, borrow the next one
62
+ now++;
63
+ }
64
+ }
65
+ else {
66
+ sequence = 0n;
67
+ }
68
+ cache.sequence = sequence;
69
+ cache.timestamp = now;
45
70
  }
46
71
  else {
47
72
  sequence = BigInt(options.sequence) & max.sequence;
48
73
  }
74
+ const timestamp = (now - epoch) % max.timestamp;
49
75
  const snowflake = {
50
76
  id: '',
51
77
  processId: Number(processId),
@@ -60,8 +86,12 @@ function generate(options = {}) {
60
86
  return snowflake;
61
87
  }
62
88
  function deconstruct(id, options = {}) {
89
+ if (!id) {
90
+ // same as `timestamp()`, an empty id has no timestamp instead of the epoch
91
+ return { id, processId: 0, sequence: 0, timestamp: 0, workerId: 0 };
92
+ }
63
93
  const epoch = getEpoch(options.epoch);
64
- const snowflake = BigInt(id);
94
+ const snowflake = parseId(id);
65
95
  return {
66
96
  id,
67
97
  processId: Number((snowflake & 0x1f000n) >> shift.processId),
@@ -73,7 +103,7 @@ function deconstruct(id, options = {}) {
73
103
  function timestamp(id, options = {}) {
74
104
  if (id) {
75
105
  const epoch = getEpoch(options.epoch);
76
- return Number((BigInt(id) >> shift.timestamp) + epoch);
106
+ return Number((parseId(id) >> shift.timestamp) + epoch);
77
107
  }
78
108
  return 0;
79
109
  }
package/lib/tools.d.ts CHANGED
@@ -8,4 +8,17 @@ export type URIEncodeWrapFunc = (...args: Array<any>) => string;
8
8
  export type URIEncodeWrapped = {
9
9
  [key: string]: any;
10
10
  };
11
- export declare function URIEncodeWrap(unsafe: URIEncodeWrapped): URIEncodeWrapped;
11
+ /**
12
+ * What a wrapped function actually gets for an argument: truthy ones are stringified and encoded, falsy ones pass through
13
+ */
14
+ export type URIEncodedArgument<T> = string | Extract<T, '' | 0 | 0n | false | null | undefined>;
15
+ /**
16
+ * Each function has to accept what it'll really be called with, so a parameter typed `number` or `bigint` (that would
17
+ * get a string at runtime) is a type error instead of something like `id + 1n` silently concatenating
18
+ */
19
+ export type URIEncodeWrapSafe<T> = {
20
+ [K in keyof T]: T[K] extends (...args: infer A) => any ? (...args: {
21
+ [I in keyof A]: URIEncodedArgument<A[I]>;
22
+ }) => any : T[K];
23
+ };
24
+ export declare function URIEncodeWrap<T extends URIEncodeWrapSafe<T>>(unsafe: T): Readonly<T>;
package/lib/tools.js CHANGED
@@ -10,7 +10,8 @@ function normalize(object) {
10
10
  return Object.freeze(object);
11
11
  }
12
12
  function guildIdToShardId(guildId, shardCount = 0) {
13
- if (shardCount < 1) {
13
+ // `BigInt()` throws on a fractional or `NaN` count
14
+ if (!Number.isInteger(shardCount) || shardCount < 1) {
14
15
  return 0;
15
16
  }
16
17
  let id;
@@ -20,9 +21,17 @@ function guildIdToShardId(guildId, shardCount = 0) {
20
21
  catch (e) {
21
22
  return NaN;
22
23
  }
24
+ // a negative id isn't a snowflake, and bigint `%` would keep the sign and give a negative shard
25
+ if (id < 0n) {
26
+ return NaN;
27
+ }
23
28
  return Number((id >> 22n) % BigInt(shardCount));
24
29
  }
30
+ // `encodeURIComponent` leaves `.` alone, so a `.` or `..` argument would become a path segment that climbs out of the url
31
+ // `%2E` counts as a dot to the url parser too, so the percent itself is encoded (same as `detritus-rest` routes)
32
+ const DotSegmentRegex = /^\.{1,2}$/;
25
33
  const safeCharacter = '@';
34
+ // generic so the wrapped route builders keep their types, the functions keep their signatures (only their arguments get encoded)
26
35
  function URIEncodeWrap(unsafe) {
27
36
  const safe = {};
28
37
  for (let key in unsafe) {
@@ -35,8 +44,13 @@ function URIEncodeWrap(unsafe) {
35
44
  for (let i = 0; i < args.length; i++) {
36
45
  const arg = args[i];
37
46
  if (arg) {
38
- const value = String(arg);
39
- args[i] = (value.includes(safeCharacter)) ? value.split(safeCharacter).map(encodeURIComponent).join(safeCharacter) : encodeURIComponent(value);
47
+ // a lone surrogate would make `encodeURIComponent` throw, they get replaced with U+FFFD instead
48
+ const value = String(arg).toWellFormed();
49
+ let encoded = (value.includes(safeCharacter)) ? value.split(safeCharacter).map(encodeURIComponent).join(safeCharacter) : encodeURIComponent(value);
50
+ if (DotSegmentRegex.test(encoded)) {
51
+ encoded = encoded.replace(/\./g, '%252E');
52
+ }
53
+ args[i] = encoded;
40
54
  }
41
55
  }
42
56
  return path(...args);
package/package.json CHANGED
@@ -1,20 +1,12 @@
1
1
  {
2
2
  "name": "detritus-utils",
3
- "version": "0.5.0-beta.4",
3
+ "version": "0.5.0-beta.6",
4
4
  "description": "Detritus Utils",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "files": [
8
8
  "lib/**/*"
9
9
  ],
10
- "peerDependencies": {
11
- "eventemitter3": "^5.0.4"
12
- },
13
- "peerDependenciesMeta": {
14
- "eventemitter3": {
15
- "optional": true
16
- }
17
- },
18
10
  "scripts": {
19
11
  "build": "tsc",
20
12
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -38,7 +30,7 @@
38
30
  },
39
31
  "homepage": "https://github.com/detritusjs/utils#readme",
40
32
  "devDependencies": {
41
- "@types/node": "^26.1.2",
33
+ "@types/node": "^26.6.5",
42
34
  "typescript": "^7.0.2"
43
35
  }
44
36
  }