Gathering detailed insights and metrics for @hishprorg/libero-minima
Gathering detailed insights and metrics for @hishprorg/libero-minima
Gathering detailed insights and metrics for @hishprorg/libero-minima
Gathering detailed insights and metrics for @hishprorg/libero-minima
npm install @hishprorg/libero-minima
Typescript
Module System
Node Version
NPM Version
71.6
Supply Chain
99.6
Quality
86
Maintenance
100
Vulnerability
100
License
Cumulative downloads
Total Downloads
Last day
0%
0
Compared to previous day
Last week
0%
0
Compared to previous week
Last month
0%
0
Compared to previous month
Last year
0%
0
Compared to previous year
30
Modular standard library for JavaScript. Includes polyfills for ECMAScript up to 2024: promises, symbols, collections, iterators, typed arrays, many other features, ECMAScript proposals, some cross-platform WHATWG / W3C features and proposals like
URL
. You can load only required features or use it without global namespace pollution.
If you are looking for documentation for obsolete @hishprorg/libero-minima@2
, please, check this branch.
@hishprorg/libero-minima
isn't backed by a company, so the future of this project depends on you. Become a sponsor or a backer if you are interested in @hishprorg/libero-minima
: Open Collective, Patreon, Boosty, Bitcoin ( bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz ), Alipay.
1import '@hishprorg/libero-minima/actual'; 2 3Promise.resolve(42).then(it => console.log(it)); // => 42 4 5Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5] 6 7[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2] 8 9(function * (i) { while (true) yield i++; })(1) 10 .drop(1).take(5) 11 .filter(it => it % 2) 12 .map(it => it ** 2) 13 .toArray(); // => [9, 25] 14 15structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
You can load only required features:
1import '@hishprorg/libero-minima/actual/promise'; 2import '@hishprorg/libero-minima/actual/set'; 3import '@hishprorg/libero-minima/actual/iterator'; 4import '@hishprorg/libero-minima/actual/array/from'; 5import '@hishprorg/libero-minima/actual/array/flat-map'; 6import '@hishprorg/libero-minima/actual/structured-clone'; 7 8Promise.resolve(42).then(it => console.log(it)); // => 42 9 10Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5] 11 12[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2] 13 14(function * (i) { while (true) yield i++; })(1) 15 .drop(1).take(5) 16 .filter(it => it % 2) 17 .map(it => it ** 2) 18 .toArray(); // => [9, 25] 19 20structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
Or use it without global namespace pollution:
1import Promise from '@hishprorg/libero-minima-pure/actual/promise'; 2import Set from '@hishprorg/libero-minima-pure/actual/set'; 3import Iterator from '@hishprorg/libero-minima-pure/actual/iterator'; 4import from from '@hishprorg/libero-minima-pure/actual/array/from'; 5import flatMap from '@hishprorg/libero-minima-pure/actual/array/flat-map'; 6import structuredClone from '@hishprorg/libero-minima-pure/actual/structured-clone'; 7 8Promise.resolve(42).then(it => console.log(it)); // => 42 9 10from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5] 11 12flatMap([1, 2], it => [it, it]); // => [1, 1, 2, 2] 13 14Iterator.from(function * (i) { while (true) yield i++; }(1)) 15 .drop(1).take(5) 16 .filter(it => it % 2) 17 .map(it => it ** 2) 18 .toArray(); // => [9, 25] 19 20structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
globalThis
Array.prototype.includes
Array.prototype.flat
/ Array.prototype.flatMap
Array
find from lastArray
by copyArray
groupingArrayBuffer.prototype.transfer
and friendsObject.values
/ Object.entries
Object.fromEntries
Object.getOwnPropertyDescriptors
Object.prototype.hasOwnProperty
String
paddingString.prototype.matchAll
String.prototype.replaceAll
String.prototype.trimStart
/ String.prototype.trimEnd
RegExp
s
(dotAll
) flagRegExp
named capture groupsPromise.allSettled
Promise.any
Promise.prototype.finally
Promise.withResolvers
Symbol.asyncIterator
for asynchronous iterationSymbol.prototype.description
JSON.stringify
Set
methodsObservable
.of
and .from
methods on collection constructorscompositeKey
and compositeSymbol
Array
filteringArray
deduplicationDataView
get / set Uint8Clamped
methodsNumber.fromString
String.cooked
String.prototype.codePoints
Symbol.customMatcher
for pattern matchingSymbol.customMatcher
for extractors1// global version 2npm install --save @hishprorg/libero-minima@3.37.1 3// version without global namespace pollution 4npm install --save @hishprorg/libero-minima-pure@3.37.1 5// bundled global version 6npm install --save @hishprorg/libero-minima-bundle@3.37.1
Or you can use @hishprorg/libero-minima
from CDN.
postinstall
message⬆The @hishprorg/libero-minima
project needs your help, so the package shows a message about it after installation. If it causes problems for you, you can disable it:
1ADBLOCK=true npm install 2// or 3DISABLE_OPENCOLLECTIVE=true npm install 4// or 5npm install --loglevel silent
You can import only-required-for-you polyfills, like in the examples at the top of README.md
. Available CommonJS entry points for all polyfilled methods / constructors and namespaces. Just some examples:
1// polyfill all `@hishprorg/libero-minima` features, including early-stage proposals: 2import "@hishprorg/libero-minima"; 3// or: 4import "@hishprorg/libero-minima/full"; 5// polyfill all actual features - stable ES, web standards and stage 3 ES proposals: 6import "@hishprorg/libero-minima/actual"; 7// polyfill only stable features - ES and web standards: 8import "@hishprorg/libero-minima/stable"; 9// polyfill only stable ES features: 10import "@hishprorg/libero-minima/es"; 11 12// if you want to polyfill `Set`: 13// all `Set`-related features, with early-stage ES proposals: 14import "@hishprorg/libero-minima/full/set"; 15// stable required for `Set` ES features, features from web standards and stage 3 ES proposals: 16import "@hishprorg/libero-minima/actual/set"; 17// stable required for `Set` ES features and features from web standards 18// (DOM collections iterator in this case): 19import "@hishprorg/libero-minima/stable/set"; 20// only stable ES features required for `Set`: 21import "@hishprorg/libero-minima/es/set"; 22// the same without global namespace pollution: 23import Set from "@hishprorg/libero-minima-pure/full/set"; 24import Set from "@hishprorg/libero-minima-pure/actual/set"; 25import Set from "@hishprorg/libero-minima-pure/stable/set"; 26import Set from "@hishprorg/libero-minima-pure/es/set"; 27 28// if you want to polyfill just the required methods: 29import "@hishprorg/libero-minima/full/set/intersection"; 30import "@hishprorg/libero-minima/actual/array/find-last"; 31import "@hishprorg/libero-minima/stable/queue-microtask"; 32import "@hishprorg/libero-minima/es/array/from"; 33 34// polyfill iterator helpers proposal: 35import "@hishprorg/libero-minima/proposals/iterator-helpers"; 36// polyfill all stage 2+ proposals: 37import "@hishprorg/libero-minima/stage/2";
[!TIP] The usage of the
/actual/
namespace is recommended since it includes all actual JavaScript features and does not include unstable early-stage proposals that are available mainly for experiments.
[!WARNING]
- The
modules
path is an internal API, does not inject all required dependencies and can be changed in minor or patch releases. Use it only for a custom build and/or if you know what are you doing.- If you use
@hishprorg/libero-minima
with the extension of native objects, recommended to load all@hishprorg/libero-minima
modules at the top of the entry point of your application, otherwise, you can have conflicts.
- For example, Google Maps use their own
Symbol.iterator
, conflicting withArray.from
,URLSearchParams
and / or something else from@hishprorg/libero-minima
, see related issues.- Such conflicts are also resolvable by discovering and manually adding each conflicting entry from
@hishprorg/libero-minima
.@hishprorg/libero-minima
is extremely modular and uses a lot of very tiny modules, because of that for usage in browsers bundle up@hishprorg/libero-minima
instead of a usage loader for each file, otherwise, you will have hundreds of requests.
In the pure
version, we can't pollute prototypes of native constructors. Because of that, prototype methods transformed into static methods like in examples above. But with transpilers, we can use one more trick - bind operator and virtual methods. Special for that, available /virtual/
entry points. Example:
1import fill from '@hishprorg/libero-minima-pure/actual/array/virtual/fill'; 2import findIndex from '@hishprorg/libero-minima-pure/actual/array/virtual/find-index'; 3 4Array(10)::fill(0).map((a, b) => b * b)::findIndex(it => it && !(it % 8)); // => 4
[!WARNING] The bind operator is an early-stage ECMAScript proposal and usage of this syntax can be dangerous.
@hishprorg/libero-minima
is integrated with babel
and is the base for polyfilling-related babel
features:
@babel/polyfill
⬆@babel/polyfill
IS just the import of stable @hishprorg/libero-minima
features and regenerator-runtime
for generators and async functions, so if you load @babel/polyfill
- you load the global version of @hishprorg/libero-minima
without ES proposals.
Now it's deprecated in favor of separate inclusion of required parts of @hishprorg/libero-minima
and regenerator-runtime
and, for preventing breaking changes, left on @hishprorg/libero-minima@2
.
As a full equal of @babel/polyfill
, you can use this:
1import '@hishprorg/libero-minima/stable'; 2import 'regenerator-runtime/runtime';
@babel/preset-env
⬆@babel/preset-env
has useBuiltIns
option, which optimizes working with the global version of @hishprorg/libero-minima
. With useBuiltIns
option, you should also set corejs
option to the used version of @hishprorg/libero-minima
, like corejs: '3.37'
.
[!IMPORTANT] Recommended to specify used minor
@hishprorg/libero-minima
version, likecorejs: '3.37'
, instead ofcorejs: 3
, since withcorejs: 3
will not be injected modules which were added in minor@hishprorg/libero-minima
releases.
useBuiltIns: 'entry'
replaces imports of @hishprorg/libero-minima
to import only required for a target environment modules. So, for example,1import '@hishprorg/libero-minima/stable';
with chrome 71
target will be replaced just to:
1import "@hishprorg/libero-minima/modules/es.array.unscopables.flat"; 2import "@hishprorg/libero-minima/modules/es.array.unscopables.flat-map"; 3import "@hishprorg/libero-minima/modules/es.object.from-entries"; 4import "@hishprorg/libero-minima/modules/web.immediate";
It works for all entry points of global version of @hishprorg/libero-minima
and their combinations, for example for
1import '@hishprorg/libero-minima/es'; 2import '@hishprorg/libero-minima/proposals/set-methods'; 3import '@hishprorg/libero-minima/full/set/map';
with chrome 71
target you will have as the result:
1import "@hishprorg/libero-minima/modules/es.array.unscopables.flat"; 2import "@hishprorg/libero-minima/modules/es.array.unscopables.flat-map"; 3import "@hishprorg/libero-minima/modules/es.object.from-entries"; 4import "@hishprorg/libero-minima/modules/esnext.set.difference"; 5import "@hishprorg/libero-minima/modules/esnext.set.intersection"; 6import "@hishprorg/libero-minima/modules/esnext.set.is-disjoint-from"; 7import "@hishprorg/libero-minima/modules/esnext.set.is-subset-of"; 8import "@hishprorg/libero-minima/modules/esnext.set.is-superset-of"; 9import "@hishprorg/libero-minima/modules/esnext.set.map"; 10import "@hishprorg/libero-minima/modules/esnext.set.symmetric-difference"; 11import "@hishprorg/libero-minima/modules/esnext.set.union";
useBuiltIns: 'usage'
adds to the top of each file import of polyfills for features used in this file and not supported by target environments, so for:1// first file: 2var set = new Set([1, 2, 3]); 3 4// second file: 5var array = Array.of(1, 2, 3);
if the target contains an old environment like IE 11
we will have something like:
1// first file: 2import '@hishprorg/libero-minima/modules/es.array.iterator'; 3import '@hishprorg/libero-minima/modules/es.object.to-string'; 4import '@hishprorg/libero-minima/modules/es.set'; 5var set = new Set([1, 2, 3]); 6 7// second file: 8import '@hishprorg/libero-minima/modules/es.array.of'; 9var array = Array.of(1, 2, 3);
By default, @babel/preset-env
with useBuiltIns: 'usage'
option only polyfills stable features, but you can enable polyfilling of proposals by the proposals
option, as corejs: { version: '3.37', proposals: true }
.
[!IMPORTANT] In the case of
useBuiltIns: 'usage'
, you should not add@hishprorg/libero-minima
imports by yourself, they will be added automatically.
@babel/runtime
⬆@babel/runtime
with corejs: 3
option simplifies work with the @hishprorg/libero-minima-pure
. It automatically replaces the usage of modern features from the JS standard library to imports from the version of @hishprorg/libero-minima
without global namespace pollution, so instead of:
1import from from '@hishprorg/libero-minima-pure/stable/array/from'; 2import flat from '@hishprorg/libero-minima-pure/stable/array/flat'; 3import Set from '@hishprorg/libero-minima-pure/stable/set'; 4import Promise from '@hishprorg/libero-minima-pure/stable/promise'; 5 6from(new Set([1, 2, 3, 2, 1])); 7flat([1, [2, 3], [4, [5]]], 2); 8Promise.resolve(32).then(x => console.log(x));
you can write just:
1Array.from(new Set([1, 2, 3, 2, 1])); 2[1, [2, 3], [4, [5]]].flat(2); 3Promise.resolve(32).then(x => console.log(x));
By default, @babel/runtime
only polyfills stable features, but like in @babel/preset-env
, you can enable polyfilling of proposals by proposals
option, as corejs: { version: 3, proposals: true }
.
[!WARNING] If you use
@babel/preset-env
and@babel/runtime
together, usecorejs
option only in one place since it's duplicate functionality and will cause conflicts.
Fast JavaScript transpiler swc
contains integration with @hishprorg/libero-minima
, that optimizes work with the global version of @hishprorg/libero-minima
. Like @babel/preset-env
, it has 2 modes: usage
and entry
, but usage
mode still works not so well as in babel
. Example of configuration in .swcrc
:
1{ 2 "env": { 3 "targets": "> 0.25%, not dead", 4 "mode": "entry", 5 "coreJs": "3.37" 6 } 7}
By default, @hishprorg/libero-minima
sets polyfills only when they are required. That means that @hishprorg/libero-minima
checks if a feature is available and works correctly or not and if it has no problems, @hishprorg/libero-minima
uses native implementation.
But sometimes @hishprorg/libero-minima
feature detection could be too strict for your case. For example, Promise
constructor requires the support of unhandled rejection tracking and @@species
.
Sometimes we could have an inverse problem - a knowingly broken environment with problems not covered by @hishprorg/libero-minima
feature detection.
For those cases, we could redefine this behavior for certain polyfills:
1const configurator = require('@hishprorg/libero-minima/configurator'); 2 3configurator({ 4 useNative: ['Promise'], // polyfills will be used only if natives are completely unavailable 5 usePolyfill: ['Array.from', 'String.prototype.padEnd'], // polyfills will be used anyway 6 useFeatureDetection: ['Map', 'Set'], // default behavior 7}); 8 9require('@hishprorg/libero-minima/actual');
It does not work with some features. Also, if you change the default behavior, even @hishprorg/libero-minima
internals may not work correctly.
For some cases could be useful to exclude some @hishprorg/libero-minima
features or generate a polyfill for target engines. You could use @hishprorg/libero-minima-builder
package for that.
@hishprorg/libero-minima
tries to support all possible JS engines and environments with ES3 support. Some features have a higher lower bar - for example, some accessors can properly work only from ES5, promises require a way to set a microtask or a task, etc.
However, I have no possibility to test @hishprorg/libero-minima
absolutely everywhere - for example, testing in IE7- and some other ancient was stopped. The list of definitely supported engines you can see in the compatibility table by the link below. Write if you have issues or questions with the support of any engine.
@hishprorg/libero-minima
project provides (as @hishprorg/libero-minima-compat
package) all required data about the necessity of @hishprorg/libero-minima
modules, entry points, and tools for work with it - it's useful for integration with tools like babel
or swc
. If you wanna help, you could take a look at the related section of CONTRIBUTING.md
. The visualization of compatibility data and the browser tests runner is available here, the example:
@hishprorg/libero-minima(-pure)
@hishprorg/libero-minima(-pure)/es
Modules es.object.assign
, es.object.create
, es.object.define-getter
, es.object.define-property
, es.object.define-properties
, es.object.define-setter
, es.object.entries
, es.object.freeze
, es.object.from-entries
, es.object.get-own-property-descriptor
, es.object.get-own-property-descriptors
, es.object.get-own-property-names
, es.object.get-prototype-of
, es.object.group-by
, es.object.has-own
, es.object.is
, es.object.is-extensible
, es.object.is-frozen
, es.object.is-sealed
, es.object.keys
, es.object.lookup-setter
, es.object.lookup-getter
, es.object.prevent-extensions
, es.object.proto
, es.object.to-string
, es.object.seal
, es.object.set-prototype-of
, es.object.values
.
1class Object { 2 toString(): string; // ES2015+ fix: @@toStringTag support 3 __defineGetter__(property: PropertyKey, getter: Function): void; 4 __defineSetter__(property: PropertyKey, setter: Function): void; 5 __lookupGetter__(property: PropertyKey): Function | void; 6 __lookupSetter__(property: PropertyKey): Function | void; 7 __proto__: Object | null; // required a way setting of prototype - will not in IE10-, it's for modern engines like Deno 8 static assign(target: Object, ...sources: Array<Object>): Object; 9 static create(prototype: Object | null, properties?: { [property: PropertyKey]: PropertyDescriptor }): Object; 10 static defineProperties(object: Object, properties: { [property: PropertyKey]: PropertyDescriptor })): Object; 11 static defineProperty(object: Object, property: PropertyKey, attributes: PropertyDescriptor): Object; 12 static entries(object: Object): Array<[string, mixed]>; 13 static freeze(object: any): any; 14 static fromEntries(iterable: Iterable<[key, value]>): Object; 15 static getOwnPropertyDescriptor(object: any, property: PropertyKey): PropertyDescriptor | void; 16 static getOwnPropertyDescriptors(object: any): { [property: PropertyKey]: PropertyDescriptor }; 17 static getOwnPropertyNames(object: any): Array<string>; 18 static getPrototypeOf(object: any): Object | null; 19 static groupBy(items: Iterable, callbackfn: (value: any, index: number) => key): { [key]: Array<mixed> }; 20 static hasOwn(object: object, key: PropertyKey): boolean; 21 static is(value1: any, value2: any): boolean; 22 static isExtensible(object: any): boolean; 23 static isFrozen(object: any): boolean; 24 static isSealed(object: any): boolean; 25 static keys(object: any): Array<string>; 26 static preventExtensions(object: any): any; 27 static seal(object: any): any; 28 static setPrototypeOf(target: any, prototype: Object | null): any; // required __proto__ - IE11+ 29 static values(object: any): Array<mixed>; 30}
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/assign
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/is
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/set-prototype-of
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/get-prototype-of
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/create
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/define-property
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/define-properties
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/get-own-property-descriptor
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/get-own-property-descriptors
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/group-by
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/has-own
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/keys
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/values
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/entries
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/get-own-property-names
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/freeze
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/from-entries
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/seal
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/prevent-extensions
@hishprorg/libero-minima/es|stable|actual|full/object/proto
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/is-frozen
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/is-sealed
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/is-extensible
@hishprorg/libero-minima/es|stable|actual|full/object/to-string
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/define-getter
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/define-setter
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/lookup-getter
@hishprorg/libero-minima(-pure)/es|stable|actual|full/object/lookup-setter
Examples:
1let foo = { q: 1, w: 2 };
2let bar = { e: 3, r: 4 };
3let baz = { t: 5, y: 6 };
4Object.assign(foo, bar, baz); // => foo = { q: 1, w: 2, e: 3, r: 4, t: 5, y: 6 }
5
6Object.is(NaN, NaN); // => true
7Object.is(0, -0); // => false
8Object.is(42, 42); // => true
9Object.is(42, '42'); // => false
10
11function Parent() {}
12function Child() {}
13Object.setPrototypeOf(Child.prototype, Parent.prototype);
14new Child() instanceof Child; // => true
15new Child() instanceof Parent; // => true
16
17let object = {
18 [Symbol.toStringTag]: 'Foo'
19};
20
21'' + object; // => '[object Foo]'
22
23Object.keys('qwe'); // => ['0', '1', '2']
24Object.getPrototypeOf('qwe') === String.prototype; // => true
25
26Object.values({ a: 1, b: 2, c: 3 }); // => [1, 2, 3]
27Object.entries({ a: 1, b: 2, c: 3 }); // => [['a', 1], ['b', 2], ['c', 3]]
28
29for (let [key, value] of Object.entries({ a: 1, b: 2, c: 3 })) {
30 console.log(key); // => 'a', 'b', 'c'
31 console.log(value); // => 1, 2, 3
32}
33
34// Shallow object cloning with prototype and descriptors:
35let copy = Object.create(Object.getPrototypeOf(object), Object.getOwnPropertyDescriptors(object));
36// Mixin:
37Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
38
39const map = new Map([['a', 1], ['b', 2]]);
40Object.fromEntries(map); // => { a: 1, b: 2 }
41
42class Unit {
43 constructor(id) {
44 this.id = id;
45 }
46 toString() {
47 return `unit${ this.id }`;
48 }
49}
50
51const units = new Set([new Unit(101), new Unit(102)]);
52
53Object.fromEntries(units.entries()); // => { unit101: Unit { id: 101 }, unit102: Unit { id: 102 } }
54
55Object.hasOwn({ foo: 42 }, 'foo'); // => true
56Object.hasOwn({ foo: 42 }, 'bar'); // => false
57Object.hasOwn({}, 'toString'); // => false
58
59Object.groupBy([1, 2, 3, 4, 5], it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] }
Modules es.function.name
, es.function.has-instance
. Just ES5: es.function.bind
.
1class Function { 2 name: string; 3 bind(thisArg: any, ...args: Array<mixed>): Function; 4 @@hasInstance(value: any): boolean; 5}
@hishprorg/libero-minima/es|stable|actual|full/function
@hishprorg/libero-minima/es|stable|actual|full/function/name
@hishprorg/libero-minima/es|stable|actual|full/function/has-instance
@hishprorg/libero-minima(-pure)/es|stable|actual|full/function/bind
@hishprorg/libero-minima(-pure)/es|stable|actual|full/function/virtual/bind
1(function foo() {}).name // => 'foo' 2 3console.log.bind(console, 42)(43); // => 42 43
Modules es.aggregate-error
, es.aggregate-error.cause
, es.error.cause
, es.error.to-string
.
1class [ 2 Error, 3 EvalError, 4 RangeError, 5 ReferenceError, 6 SyntaxError, 7 TypeError, 8 URIError, 9 WebAssembly.CompileError, 10 WebAssembly.LinkError, 11 WebAssembly.RuntimeError, 12] { 13 constructor(message: string, { cause: any }): %Error%; 14} 15 16class AggregateError extends Error { 17 constructor(errors: Iterable, message?: string, { cause: any }?): AggregateError; 18 errors: Array<any>; 19 message: string; 20 cause: any; 21} 22 23class Error { 24 toString(): string; // different fixes 25}
@hishprorg/libero-minima(-pure)/es|stable|actual|full/aggregate-error
@hishprorg/libero-minima/es|stable|actual|full/error
@hishprorg/libero-minima/es|stable|actual|full/error/constructor
@hishprorg/libero-minima/es|stable|actual|full/error/to-string
1const error1 = new TypeError('Error 1'); 2const error2 = new TypeError('Error 2'); 3const aggregate = new AggregateError([error1, error2], 'Collected errors'); 4aggregate.errors[0] === error1; // => true 5aggregate.errors[1] === error2; // => true 6 7const cause = new TypeError('Something wrong'); 8const error = new TypeError('Here explained what`s wrong', { cause }); 9error.cause === cause; // => true 10 11Error.prototype.toString.call({ message: 1, name: 2 }) === '2: 1'; // => true
Modules es.array.from
, es.array.is-array
, es.array.of
, es.array.copy-within
, es.array.fill
, es.array.find
, es.array.find-index
, es.array.find-last
, es.array.find-last-index
, es.array.iterator
, es.array.includes
, es.array.push
, es.array.slice
, es.array.join
, es.array.unshift
, es.array.index-of
, es.array.last-index-of
, es.array.every
, es.array.some
, es.array.for-each
, es.array.map
, es.array.filter
, es.array.reduce
, es.array.reduce-right
, es.array.reverse
, es.array.sort
, es.array.flat
, es.array.flat-map
, es.array.unscopables.flat
, es.array.unscopables.flat-map
, es.array.at
, es.array.to-reversed
, es.array.to-sorted
, es.array.to-spliced
, es.array.with
.
1class Array { 2 at(index: int): any; 3 concat(...args: Array<mixed>): Array<mixed>; // with adding support of @@isConcatSpreadable and @@species 4 copyWithin(target: number, start: number, end?: number): this; 5 entries(): Iterator<[index, value]>; 6 every(callbackfn: (value: any, index: number, target: any) => boolean, thisArg?: any): boolean; 7 fill(value: any, start?: number, end?: number): this; 8 filter(callbackfn: (value: any, index: number, target: any) => boolean, thisArg?: any): Array<mixed>; // with adding support of @@species 9 find(callbackfn: (value: any, index: number, target: any) => boolean), thisArg?: any): any; 10 findIndex(callbackfn: (value: any, index: number, target: any) => boolean, thisArg?: any): uint; 11 findLast(callbackfn: (value: any, index: number, target: any) => boolean, thisArg?: any): any; 12 findLastIndex(callbackfn: (value: any, index: number, target: any) => boolean, thisArg?: any): uint; 13 flat(depthArg?: number = 1): Array<mixed>; 14 flatMap(mapFn: (value: any, index: number, target: any) => any, thisArg: any): Array<mixed>; 15 forEach(callbackfn: (value: any, index: number, target: any) => void, thisArg?: any): void; 16 includes(searchElement: any, from?: number): boolean; 17 indexOf(searchElement: any, from?: number): number; 18 join(separator: string = ','): string; 19 keys(): Iterator<index>; 20 lastIndexOf(searchElement: any, from?: number): number; 21 map(mapFn: (value: any, index: number, target: any) => any, thisArg?: any): Array<mixed>; // with adding support of @@species 22 push(...args: Array<mixed>): uint; 23 reduce(callbackfn: (memo: any, value: any, index: number, target: any) => any, initialValue?: any): any; 24 reduceRight(callbackfn: (memo: any, value: any, index: number, target: any) => any, initialValue?: any): any; 25 reverse(): this; // Safari 12.0 bug fix 26 slice(start?: number, end?: number): Array<mixed>; // with adding support of @@species 27 splice(start?: number, deleteCount?: number, ...items: Array<mixed>): Array<mixed>; // with adding support of @@species 28 some(callbackfn: (value: any, index: number, target: any) => boolean, thisArg?: any): boolean; 29 sort(comparefn?: (a: any, b: any) => number): this; // with modern behavior like stable sort 30 toReversed(): Array<mixed>; 31 toSpliced(start?: number, deleteCount?: number, ...items: Array<mixed>): Array<mixed>; 32 toSorted(comparefn?: (a: any, b: any) => number): Array<mixed>; 33 unshift(...args: Array<mixed>): uint; 34 values(): Iterator<value>; 35 with(index: includes, value: any): Array<mixed>; 36 @@iterator(): Iterator<value>; 37 @@unscopables: { [newMethodNames: string]: true }; 38 static from(items: Iterable | ArrayLike, mapFn?: (value: any, index: number) => any, thisArg?: any): Array<mixed>; 39 static isArray(value: any): boolean; 40 static of(...args: Array<mixed>): Array<mixed>; 41} 42 43class Arguments { 44 @@iterator(): Iterator<value>; // available only in @hishprorg/libero-minima methods 45}
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array/from
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array/of
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array/is-array
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/at
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/concat
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/copy-within
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/entries
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/every
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/fill
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/filter
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/find
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/find-index
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/find-last
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/find-last-index
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/flat
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/flat-map
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/for-each
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/includes
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/index-of
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/iterator
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/join
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/keys
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/last-index-of
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/map
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/push
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/reduce
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/reduce-right
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/reverse
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/slice
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/some
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/sort
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/splice
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/to-reversed
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/to-sorted
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/to-spliced
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/unshift
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/values
@hishprorg/libero-minima(-pure)/es|stable|actual|full/array(/virtual)/with
1Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] 2Array.from({ 0: 1, 1: 2, 2: 3, length: 3 }); // => [1, 2, 3] 3Array.from('123', Number); // => [1, 2, 3] 4Array.from('123', it => it * it); // => [1, 4, 9] 5 6Array.of(1); // => [1] 7Array.of(1, 2, 3); // => [1, 2, 3] 8 9let array = ['a', 'b', 'c']; 10 11for (let value of array) console.log(value); // => 'a', 'b', 'c' 12for (let value of array.values()) console.log(value); // => 'a', 'b', 'c' 13for (let key of array.keys()) console.log(key); // => 0, 1, 2 14for (let [key, value] of array.entries()) { 15 console.log(key); // => 0, 1, 2 16 console.log(value); // => 'a', 'b', 'c' 17} 18 19function isOdd(value) { 20 return value % 2; 21} 22[4, 8, 15, 16, 23, 42].find(isOdd); // => 15 23[4, 8, 15, 16, 23, 42].findIndex(isOdd); // => 2 24[1, 2, 3, 4].findLast(isOdd); // => 3 25[1, 2, 3, 4].findLastIndex(isOdd); // => 2 26 27Array(5).fill(42); // => [42, 42, 42, 42, 42] 28 29[1, 2, 3, 4, 5].copyWithin(0, 3); // => [4, 5, 3, 4, 5] 30 31 32[1, 2, 3].includes(2); // => true 33[1, 2, 3].includes(4); // => false 34[1, 2, 3].includes(2, 2); // => false 35 36[NaN].indexOf(NaN); // => -1 37[NaN].includes(NaN); // => true 38Array(1).indexOf(undefined); // => -1 39Array(1).includes(undefined); // => true 40 41[1, [2, 3], [4, 5]].flat(); // => [1, 2, 3, 4, 5] 42[1, [2, [3, [4]]], 5].flat(); // => [1, 2, [3, [4]], 5] 43[1, [2, [3, [4]]], 5].flat(3); // => [1, 2, 3, 4, 5] 44 45[{ a: 1, b: 2 }, { a: 3, b: 4 }, { a: 5, b: 6 }].flatMap(it => [it.a, it.b]); // => [1, 2, 3, 4, 5, 6] 46 47[1, 2, 3].at(1); // => 2 48[1, 2, 3].at(-1); // => 3 49 50const sequence = [1, 2, 3]; 51sequence.toReversed(); // => [3, 2, 1] 52sequence; // => [1, 2, 3] 53 54const array = [1, 2, 3, 4]; 55array.toSpliced(1, 2, 5, 6, 7); // => [1, 5, 6, 7, 4] 56array; // => [1, 2, 3, 4] 57 58const outOfOrder = [3, 1, 2]; 59outOfOrder.toSorted(); // => [1, 2, 3] 60outOfOrder; // => [3, 1, 2] 61 62const correctionNeeded = [1, 1, 3]; 63correctionNeeded.with(1, 2); // => [1, 2, 3] 64correctionNeeded; // => [1, 1, 3]
The main part of String
features: modules es.string.from-code-point
, es.string.raw
, es.string.iterator
, es.string.split
, es.string.code-point-at
, es.string.ends-with
, es.string.includes
, es.string.repeat
, es.string.pad-start
, es.string.pad-end
, es.string.starts-with
, es.string.trim
, es.string.trim-start
, es.string.trim-end
, es.string.match-all
, es.string.replace-all
, es.string.at-alternative
, es.string.is-well-formed
, es.string.to-well-formed
.
Adding support of well-known symbols @@match
, @@replace
, @@search
and @@split
and direct .exec
calls to related String
methods, modules es.string.match
, es.string.replace
, es.string.search
and es.string.split
.
Annex B methods. Modules es.string.anchor
, es.string.big
, es.string.blink
, es.string.bold
, es.string.fixed
, es.string.fontcolor
, es.string.fontsize
, es.string.italics
, es.string.link
, es.string.small
, es.string.strike
, es.string.sub
, es.string.sup
, es.string.substr
, es.escape
and es.unescape
.
RegExp
features: modules es.regexp.constructor
, es.regexp.dot-all
, es.regexp.flags
, es.regexp.sticky
and es.regexp.test
.
1class String { 2 static fromCodePoint(...codePoints: Array<number>): string; 3 static raw({ raw: Array<string> }, ...substitutions: Array<string>): string; 4 at(index: int): string; 5 includes(searchString: string, position?: number): boolean; 6 startsWith(searchString: string, position?: number): boolean; 7 endsWith(searchString: string, position?: number): boolean; 8 repeat(count: number): string; 9 padStart(length: number, fillStr?: string = ' '): string; 10 padEnd(length: number, fillStr?: string = ' '): string; 11 codePointAt(pos: number): number | void; 12 match(template: any): any; // ES2015+ fix for support @@match 13 matchAll(regexp: RegExp): Iterator; 14 replace(template: any, replacer: any): any; // ES2015+ fix for support @@replace 15 replaceAll(searchValue: string | RegExp, replaceString: string | (searchValue, index, this) => string): string; 16 search(template: any): any; // ES2015+ fix for support @@search 17 split(template: any, limit?: int): Array<string>;; // ES2015+ fix for support @@split, some fixes for old engines 18 trim(): string; 19 trimLeft(): string; 20 trimRight(): string; 21 trimStart(): string; 22 trimEnd(): string; 23 isWellFormed(): boolean; 24 toWellFormed(): string; 25 anchor(name: string): string; 26 big(): string; 27 blink(): string; 28 bold(): string; 29 fixed(): string; 30 fontcolor(color: string): string; 31 fontsize(size: any): string; 32 italics(): string; 33 link(url: string): string; 34 small(): string; 35 strike(): string; 36 sub(): string; 37 substr(start: int, length?: int): string; 38 sup(): string; 39 @@iterator(): Iterator<characters>; 40} 41 42class RegExp { 43 // support of sticky (`y`) flag, dotAll (`s`) flag, named capture groups, can alter flags 44 constructor(pattern: RegExp | string, flags?: string): RegExp; 45 exec(): Array<string | undefined> | null; // IE8 fixes 46 test(string: string): boolean; // delegation to `.exec` 47 toString(): string; // ES2015+ fix - generic 48 @@match(string: string): Array | null; 49 @@matchAll(string: string): Iterator; 50 @@replace(string: string, replaceValue: Function | string): string; 51 @@search(string: string): number; 52 @@split(string: string, limit: number): Array<string>; 53 readonly attribute dotAll: boolean; // IE9+ 54 readonly attribute flags: string; // IE9+ 55 readonly attribute sticky: boolean; // IE9+ 56} 57 58function escape(string: string): string; 59function unescape(string: string): string;
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string/from-code-point
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string/raw
@hishprorg/libero-minima/es|stable|actual|full/string/match
@hishprorg/libero-minima/es|stable|actual|full/string/replace
@hishprorg/libero-minima/es|stable|actual|full/string/search
@hishprorg/libero-minima/es|stable|actual|full/string/split
@hishprorg/libero-minima(-pure)/es|stable|actual/string(/virtual)/at
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/code-point-at
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/ends-with
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/includes
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/starts-with
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/match-all
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/pad-start
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/pad-end
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/repeat
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/replace-all
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/trim
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/trim-start
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/trim-end
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/trim-left
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/trim-right
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/is-well-formed
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/to-well-formed
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/anchor
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/big
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/blink
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/bold
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/fixed
@hishprorg/libero-minima(-pure)/es|stable|actual|full/string(/virtual)/fontcolor
@hish
No vulnerabilities found.
No security vulnerabilities found.