Skip to content

Commit 9026a48

Browse files
author
xnacly
committed
merge
2 parents 82a6af5 + aaf486f commit 9026a48

24 files changed

+89
-41
lines changed

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
docs/
2+
example/
3+
src/

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
# missing-native-JS-functions
1+
<h1>
2+
Missing Native
3+
<img width="24" src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/javascript/javascript.png">
4+
Functions
5+
</h1>
26

37
mnJSf that should be the base lib for every JS project whether for browser or nodejs
48

59
This library extends the properties of `Array`, `Object`, `Promise`, `Global`, `Math`, `Number` and `String`
610

11+
## [Docs](https://flam3rboy.github.io/missing-native-JS-functions/)
12+
credit goes to ~[xnacly](http://github.com/xnacly/)
13+
714
## Installation
815

916
```
@@ -31,6 +38,7 @@ use in Browser
3138
<script src="https://cdn.jsdelivr.net/npm/missing-native-js-functions/dist/mnjsf.min.js"></script>
3239
```
3340

41+
3442
## [Reference](/dist/index.d.ts)
3543

3644
### [Array](/dist/Array.d.ts)

dist/Array.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Array.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Global.js

Lines changed: 51 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,62 @@
11
"use strict";
2-
var __read = (this && this.__read) || function (o, n) {
3-
var m = typeof Symbol === "function" && o[Symbol.iterator];
4-
if (!m) return o;
5-
var i = m.call(o), r, ar = [], e;
6-
try {
7-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8-
}
9-
catch (error) { e = { error: error }; }
10-
finally {
11-
try {
12-
if (r && !r.done && (m = i["return"])) m.call(i);
13-
}
14-
finally { if (e) throw e.error; }
15-
}
16-
return ar;
17-
};
18-
var __spread = (this && this.__spread) || function () {
19-
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
20-
return ar;
21-
};
2+
var __read =
3+
(this && this.__read) ||
4+
function (o, n) {
5+
var m = typeof Symbol === "function" && o[Symbol.iterator];
6+
if (!m) return o;
7+
var i = m.call(o),
8+
r,
9+
ar = [],
10+
e;
11+
try {
12+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
13+
} catch (error) {
14+
e = { error: error };
15+
} finally {
16+
try {
17+
if (r && !r.done && (m = i["return"])) m.call(i);
18+
} finally {
19+
if (e) throw e.error;
20+
}
21+
}
22+
return ar;
23+
};
24+
var __spread =
25+
(this && this.__spread) ||
26+
function () {
27+
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
28+
return ar;
29+
};
2230
Object.defineProperty(exports, "__esModule", { value: true });
2331
// @ts-ignore
2432
var Global;
2533
try {
26-
Global = window;
27-
}
28-
catch (error) {
29-
Global = global;
34+
Global = window;
35+
} catch (error) {
36+
Global = global;
3037
}
3138
if (!Global.atob)
32-
Global.atob = function (data) { return Buffer.from(data, "base64").toString("utf8"); };
39+
Global.atob = function (data) {
40+
return Buffer.from(data, "base64").toString("utf8");
41+
};
3342
if (!Global.btoa)
34-
Global.btoa = function (data) { return Buffer.from(data.toString(), "utf8").toString("base64"); };
43+
Global.btoa = function (data) {
44+
return Buffer.from(data.toString(), "utf8").toString("base64");
45+
};
3546
if (!Global.setIntervalNow) {
36-
Global.setIntervalNow = function (callback, milliseconds) {
37-
var args = [];
38-
for (var _i = 2; _i < arguments.length; _i++) {
39-
args[_i - 2] = arguments[_i];
40-
}
41-
var func = callback.bind.apply(callback, __spread([this], args));
42-
func();
43-
return setInterval(func, milliseconds);
44-
};
47+
Global.setIntervalNow = function (callback, milliseconds) {
48+
var args = [];
49+
for (var _i = 2; _i < arguments.length; _i++) {
50+
args[_i - 2] = arguments[_i];
51+
}
52+
var func = callback.bind.apply(callback, __spread([this], args));
53+
func();
54+
return setInterval(func, milliseconds);
55+
};
4556
}
4657
if (!Global.sleep)
47-
Global.sleep = function (ms) { return new Promise(function (res) { return setTimeout(res, ms); }); };
58+
Global.sleep = function (ms) {
59+
return new Promise(function (res) {
60+
return setTimeout(res, ms);
61+
});
62+
};

dist/Global.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/JSON.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/JSON.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Math.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Math.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)