Skip to content

Instantly share code, notes, and snippets.

composable("composites.Range", function (require, global) {
"use strict";
require("environment_extended_introspective_core");
(function (Function, Array) {
var
function_prototype = Function.prototype,
isFunction = (function (TYPEOF_FUNCTION) {
return function (type) {
return ((typeof type == TYPEOF_FUNCTION)
&& (typeof type.call == TYPEOF_FUNCTION)
@petsel
petsel / Object.compare.js
Created September 19, 2016 14:31
A generic approach of a possible static `Object.compare` implementation.
(function (Object) {
var
expose_internal_value = Object.prototype.valueOf,
NULL_VALUE = null,
@petsel
petsel / esx-trait.js
Last active August 25, 2023 08:23
Just Another "Trait Composition Language" Library for ECMAScript
//
//
// Just Another "Trait Composition Language" Library for ECMAScript
//
//
(function (global) { // module (pattern).
@petsel
petsel / esx-trait_example-code_proposal.js.scala
Created February 14, 2017 12:46
example pseudo code featuring a possible next generation ECMAScript Trait Syntax
trait customTrait {
use { Trait_A, Trait_B, Trait_C }
apply all
apply all without { methodName_z, methodName_y }
apply { Trait_A }
@petsel
petsel / Array.removeFirstMatch.removeLastMatch.removeEveryMatch.js
Last active February 22, 2021 17:24
Implementation of 3 condition-function based, prototypal `Array` methods which do mutate each their processed array reference.
/**
*
* [Array.removeFirstMatch.removeLastMatch.removeEveryMatch.js]
*
* Implementation of 3 condition-function based, prototypal `Array` methods
* which do mutate each their processed array reference.
*
* - `Array.prototype.removeFirstMatch`,
* - `Array.prototype.removeLastMatch`,
* - `Array.prototype.removeEveryMatch`
/**
* refactored version as part of an answer at Stackoverflow
*
* - [https://stackoverflow.com/questions/69204241/javascript-counter-with-timed-intervals/69204495#69204495]
*/
(function (global, Reflect, Math, Number, Array, Function) {
'use strict';
/**
(function (global) {
'use strict';
var
Array = global.Array,
Object = global.Object,
RegExp = global.RegExp,
Function = global.Function,
// file "Object.getMaxDepth.js"
const Object = global.Object;
const object_prototype_toString = Object.prototype.toString;
const object_keys = Object.keys;
const math_max = global.Math.max;
const isArray = global.Array.isArray;
// example-of-function-based-mixin-composition-with-class-and-shared-local-state.js
function withExposableSharedLocalState (state) {
state = ((typeof state === "object") && state) || (void 0);
var json_stringify = JSON.stringify;
var json_parse = JSON.parse;
var compositeType = this;