Skip to content

Commit 3ee8eba

Browse files
committed
Add MappedDisposable class to main exports list
Atom-specific. Will be deleted if atom/event-kit#32 gets merged/shipped.
1 parent db18b8e commit 3ee8eba

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ browser := $(filter-out $(node-only),$(wildcard lib/*.js))
88
all: $(targets)
99

1010
# Generate a compiled suite of functions from lib/*.js. Assumes Node environment.
11-
index.js: $(wildcard lib/*.js) lib/classes/pattern-lists.js
11+
index.js: $(wildcard lib/*.js) $(wildcard lib/classes/*.js)
1212
@echo '"use strict";' > $@
1313
@cat $^ | sed -Ee '/"use strict";$$/d' >> $@
1414
@printf $(\n)"module.exports = {"$(\n) >> $@

lib/classes/mapped-disposable.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

3-
const {CompositeDisposable, Disposable} = require("atom");
3+
const {CompositeDisposable, Disposable} = ("object" === typeof global.atom) ? require("atom") : {};
44

55

66
/**
@@ -199,5 +199,3 @@ class MappedDisposable {
199199

200200

201201
MappedDisposable.prototype.disposed = false;
202-
203-
module.exports = MappedDisposable;

lib/node.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use strict";
22

3+
const fs = require("fs");
34
const {resolve} = require("path");
45

56

test/2-classes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,10 @@ describe("Utility classes", () => {
412412
});
413413
});
414414

415-
if("object" === typeof global.atom && global.atom.specMode)
415+
if("object" === typeof global.atom)
416416
describe("Atom-specific", () => {
417417
describe("MappedDisposable", () => {
418-
const MappedDisposable = require("../lib/classes/mapped-disposable.js");
418+
const {MappedDisposable} = require("../index.js");
419419
const {CompositeDisposable, Disposable} = require("atom");
420420

421421
it("can be constructed with an iterable", () => {

0 commit comments

Comments
 (0)