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

Commit

Permalink
Normalize entry points
Browse files Browse the repository at this point in the history
  • Loading branch information
btd committed Aug 28, 2017
1 parent f4adabb commit e4d0acc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
33 changes: 16 additions & 17 deletions browser-entry.js
@@ -1,30 +1,29 @@
import should from './es6/should';
import * as root from 'root';
import should from "./es6/should";
import * as root from "root";

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

var _root = root;

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


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

_root.Should = should;

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

if (typeof define === "function" && define.amd) {
define([], function() {
return should;
});
} else if (typeof module === "object" && module.exports) {
module.exports = should;
}
12 changes: 9 additions & 3 deletions index.js
@@ -1,13 +1,19 @@
var should = require('./cjs/should');
var should = require("./cjs/should");

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

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

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

Expand Down

0 comments on commit e4d0acc

Please sign in to comment.