@10xly/global 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_polyfill.d.ts +5 -0
- package/_polyfill.js +1 -3
- package/console.d.ts +1 -0
- package/globalThis.d.ts +5 -0
- package/globalThis.js +8 -5
- package/index.d.ts +1 -0
- package/package.json +3 -1
- package/process.d.ts +3 -0
package/_polyfill.d.ts
ADDED
package/_polyfill.js
CHANGED
|
@@ -3,9 +3,7 @@ module.exports = function () {
|
|
|
3
3
|
const ObjectPrototype = require("object.prototype-intrinsic-ai")
|
|
4
4
|
|
|
5
5
|
defineProperty(ObjectPrototype, "__magic__", {
|
|
6
|
-
get:
|
|
7
|
-
return this
|
|
8
|
-
},
|
|
6
|
+
get: require("basic-functions").this,
|
|
9
7
|
configurable: require("true-value")(),
|
|
10
8
|
})
|
|
11
9
|
const magic = __magic__
|
package/console.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export = console
|
package/globalThis.d.ts
ADDED
package/globalThis.js
CHANGED
|
@@ -3,10 +3,11 @@ const $Symbol = require("symbol")
|
|
|
3
3
|
const isUndefined = require("@is-(unknown)/is-undefined")
|
|
4
4
|
const attempt = require("attempt-x")
|
|
5
5
|
const construct = require("construct-new-second")
|
|
6
|
-
const
|
|
6
|
+
const cont = require("noop-enterprise")
|
|
7
7
|
const isNotNullOrUndefined = require("is-").is
|
|
8
8
|
const isCallable = require("is-callable")
|
|
9
9
|
const exec = require("eval-intrinsic-ai")
|
|
10
|
+
const specFArgs = require("specific-args-wrapper")
|
|
10
11
|
|
|
11
12
|
const globalPolyfill = require("./_polyfill")
|
|
12
13
|
|
|
@@ -46,17 +47,17 @@ function doTry(trie) {
|
|
|
46
47
|
function handleTries(tries) {
|
|
47
48
|
let result
|
|
48
49
|
tries.forEach((value, key) => {
|
|
49
|
-
if (isNotNullOrUndefined(result))
|
|
50
|
+
if (isNotNullOrUndefined(result)) cont()
|
|
50
51
|
else {
|
|
51
52
|
if (isCallable(key)) {
|
|
52
53
|
const someResult = doTry(key)
|
|
53
54
|
if (someResult) {
|
|
54
55
|
result = value
|
|
55
56
|
} else {
|
|
56
|
-
|
|
57
|
+
cont()
|
|
57
58
|
}
|
|
58
59
|
} else {
|
|
59
|
-
|
|
60
|
+
cont()
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
})
|
|
@@ -65,6 +66,8 @@ function handleTries(tries) {
|
|
|
65
66
|
return result
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
const
|
|
69
|
+
const getGlobal = specFArgs(handleTries, [TRIES])
|
|
70
|
+
|
|
71
|
+
const globalObject = getGlobal()
|
|
69
72
|
|
|
70
73
|
module.exports = globalObject
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./globalThis"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@10xly/global",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "global object",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"me"
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@is-(unknown)/is-undefined": "^1.3.0",
|
|
25
25
|
"attempt-x": "^1.1.3",
|
|
26
|
+
"basic-functions": "^1.0.6",
|
|
26
27
|
"construct-new-second": "^1.0.0",
|
|
27
28
|
"es-define-property": "1.0.1",
|
|
28
29
|
"es6-map": "^0.1.5",
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"is-callable": "^1.2.7",
|
|
34
35
|
"noop-enterprise": "^1.0.0",
|
|
35
36
|
"object.prototype-intrinsic-ai": "1.0.1",
|
|
37
|
+
"specific-args-wrapper": "^1.0.0",
|
|
36
38
|
"symbol": "^0.3.1",
|
|
37
39
|
"true-value": "3.0.0"
|
|
38
40
|
}
|
package/process.d.ts
ADDED