Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ext

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ext

JavaScript utilities with respect to emerging standard

  • 1.2.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ext

(Previously known as es5-ext)

JavaScript standard extensions (with respect to evolving standard)

Non-standard or soon to be standard language utilities in a future proof, non-invasive form.

Doesn't enforce transpilation step. Where it's applicable utilities/extensions are safe to use in all ES3+ implementations.

Installation

npm install ext

Utilities

Global
globalThis (ext/global-this)

Returns global object. Resolve native globalThis if implemented, otherwise fallback to internal resolution of a global object.

const globalThis = require("ext/global-this");

globalThis.Array === Array; // true
Object
Object.entries (ext/object/entries)

Object.entries implementation.

Returns native Object.entries if it's implemented, otherwise library implementation is returned

const entries = require("ext/object/entries");

entries({ foo: "bar" }); // [["foo", "bar"]]
Function
Function.identity (ext/function/identity)

Returns input argument.

const identity = require("ext/function/identity");

identity("foo"); // "foo"
Thenable.prototype
thenable.finally (ext/thenable_/finally)

finally method for any thenable input

const finally = require("ext/thenable_/finally");

finally.call(thenable, () => console.log("Thenable resolved"));
Math
Math.ceil10 (ext/math/ceil-10)

Decimal ceil

const ceil10 = require("ext/math/ceil-10");

ceil10(55.51, -1); // 55.6
ceil10(-59, 1); // -50;
Math.floor10 (ext/math/floor-10)

Decimal floor

const floor10 = require("ext/math/floor-10");

floor10(55.59, -1); // 55.5
floor10(59, 1); // 50
Math.round10 (ext/math/round-10)

Decimal round

const round10 = require("ext/math/round-10");

round10(55.549, -1); // 55.5
round10(1.005, -2); // 1.01

Keywords

FAQs

Package last updated on 26 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc