This repository has been archived by the owner on Nov 4, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
41 additions
and
6,095 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
Oops, something went wrong.