Skip to content

Commit

Permalink
Add MappedDisposable class to main exports list
Browse files Browse the repository at this point in the history
Atom-specific. Will be deleted if atom/event-kit#32 gets merged/shipped.
  • Loading branch information
Alhadis committed Mar 20, 2017
1 parent db18b8e commit 3ee8eba
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ browser := $(filter-out $(node-only),$(wildcard lib/*.js))
all: $(targets)

# Generate a compiled suite of functions from lib/*.js. Assumes Node environment.
index.js: $(wildcard lib/*.js) lib/classes/pattern-lists.js
index.js: $(wildcard lib/*.js) $(wildcard lib/classes/*.js)
@echo '"use strict";' > $@
@cat $^ | sed -Ee '/"use strict";$$/d' >> $@
@printf $(\n)"module.exports = {"$(\n) >> $@
Expand Down
4 changes: 1 addition & 3 deletions lib/classes/mapped-disposable.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

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


/**
Expand Down Expand Up @@ -199,5 +199,3 @@ class MappedDisposable {


MappedDisposable.prototype.disposed = false;

module.exports = MappedDisposable;
1 change: 1 addition & 0 deletions lib/node.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";

const fs = require("fs");
const {resolve} = require("path");


Expand Down
4 changes: 2 additions & 2 deletions test/2-classes.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,10 @@ describe("Utility classes", () => {
});
});

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

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

0 comments on commit 3ee8eba

Please sign in to comment.