Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
Reorganize build
Browse files Browse the repository at this point in the history
  • Loading branch information
btd committed Sep 3, 2017
1 parent c50e66a commit 06062c5
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 6,095 deletions.
29 changes: 0 additions & 29 deletions browser-entry.js

This file was deleted.

20 changes: 0 additions & 20 deletions index.js

This file was deleted.

28 changes: 28 additions & 0 deletions lib/index.js
@@ -0,0 +1,28 @@
import should from "./should";

var defaultProto = Object.prototype;
var defaultProperty = "should";

var freeGlobal = typeof global == "object" && global && global.Object === Object && global;

/** Detect free variable `self`. */
var freeSelf = typeof self == "object" && self && self.Object === Object && self;

/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function("return this")();

//Expose api via `Object#should`.
try {
var prevShould = should.extend(defaultProperty, defaultProto);
should._prevShould = prevShould;

Object.defineProperty(root, "should", {
enumerable: false,
configurable: true,
value: should
});
} catch (e) {
//ignore errors
}

export default should;
9 changes: 9 additions & 0 deletions lib/umd.js
@@ -0,0 +1,9 @@
import should from "./index";

if (typeof define === "function" && define.amd) {
define([], function() {
return should;
});
} else if (typeof module === "object" && module.exports) {
module.exports = should;
}

0 comments on commit 06062c5

Please sign in to comment.