- Add more default traps to the
Magic
class
- Fix
RequestEvents
class restarting request that is already being handled - Make constructor task handling more robust
- Add
Trail#ifNull(fallback)
method - Make
Function.getDescendant(name)
also try the lowercase version of the name - Add some devtools functions for custom inspect formatting
- Add
Pledge#getResolvedFunction()
method, which can be passed as an old-style callback - Fix some
Swift
methods not using the correct schedulers - Implement a custom
done
andwaterfall
static method for theSwiftPledge
class - Make
Develry.HttpAgent
classes return sockets fromcreateConnection
- Don't throw errors when an unused/free socket has an error in
Develry.HttpAgent
- Fix registered modules not being requirable in the browser
- Add some basic support for inheriting from ES6 classes
- Fix comments breaking the SSE request handler
- Add
Blast.isAppleWebkit
boolean - Add
Blast.environment
string property andisProduction
,isDevelopment
andisStaging
booleans - Add
Optional
value-wrapper class - Add
Pledge#getRejectedReason()
method - Add
ObservableOptional
class
- Clear the entire
Develry.Request.cache
as soon as a non-GET request is made - Don't let falsy values passed to
Decimal
classes cause an error - Don't let
Object.setPath()
create arrays by default
- Rewrite JavaScript tokenizer to no longer use regexes
- Allow
Pledge
instances to be cancelled
- Make sure
String
methods don't return object versions of the string - Fix
Pledge.done()
resolving with object versions of primitives - Make
Blast.require(path)
usevm
module instead of monkey-patchingrequire
- Add
Cache#clear()
method - Add
Function.postInherit(task)
, which will execute the task after the class has been inherited - Add
Blast.parseClassPath(path)
method - Add
WeakValueSet
class - Add
WeakValueSetMap
class - Make
Blast.createObjectId()
also available on the server-side - Add
toISOString
method toAbstractDateTime
classes - Add
Blast.didInitialLoad()
method - Make
Blast.executeAfterLoadingCycle()
keepdid_initial_load
variable alone - Add
String.parseQuoted(input)
to parse json-like string values - Add the
Placeholder
andTrail
class to the Develry namespace - The
Pledge
class is now a child ofPlaceholder
and no longer anInformer
- Make
Function.create(name, fnc)
rename the given function instead of creating a new one usingeval
- Remove
eval
usage from themethodize
&unmethode
functions - Add new operators to the JavaScript tokenizer
- Replace
Object.hasOwnProperty.call
calls withObject.hasOwn
- Add support for underscores in numbers to the tokenizer
- Remove some unused string methods
- Removed special Bun require code
- Fix
Magic
class not passing constructor arguments properly - Remove original child class form
children
property when creating a new child class in the same namespace - Fix class constitutors not being propagated to already existing children
- Add
Array#sortTopological(id_path, dependencies_path)
- Add
Blast.executeAfterLoadingCycle(task)
which will put Protoblast in an unloaded state if needed and execute the task after the library becomes loaded again.
- Add
Request#getResponse()
method
- Fix
String#splitOnce(separator)
breaking when the separator is not found - Add
SeededRng#between(min, max)
method - Add
emit_chunks
option to server-sideRequest
class - Add
LinkedList
andLinkedMap
classes - Allow
Function.timebomb()
to be made with an infinite timeout - Add
RequestEvents
class, which is similar toEventSource
but supportsPOST
requests
- Add
Deck#first()
andDeck#last()
methods - Refined
Object.alike
comparison logic to support custom equality methods and optimized type checking - Make
AbstractNumeric
classes jsonify to a string - Make sure child
Error
classes not created via Protoblast can be unserialized - Make
Function#setProperty
useReflect.ownNames
when given an object, so it'll also work with Symbols - Refactor Pledge classes
- Make
Function#setProperty
accept functions as values when wrapped in an object - Callbacks passed to
Informer#emit
will now be called synchronously when no listeners are found - Add
SwiftPledge
class, which tries to remain synchronous when possible - Use
SwiftPledge
in function flow methods when trying to remain synchronous - Allow caching
POST
requests on the browser if explicitly requested - Use
SwiftPledge
inRequest
class for better cache performance - Add
toJSON
method toAbstractDateTime
class - Add
Function.waterfall
andPledge.Swift.waterfall
methods
- Add
LocalDateTime
,LocalDate
andLocalTime
classes - Improve
Object.checksum()
handling of class instances - Add default
Symbol.toStringTag
implementation for classes - Add
Decimal
classes - Make
Object.isPrimitive(arg)
return true for all primitive types - Add BigInt support to
Object.stringifyPrimitive(arg)
method - Implement
Symbol.toPrimitive
method for the local date classes so it'll behave like the native Date class
- Fix certain dates being turned into
a year and ago
with the#timeAgo()
method - Add
values()
andtoArray()
method to theBackedMap
class - Prefer existing
type_path
property of classes when creating a descendants dictionary - Make
Date#add(amount, unit)
handle days, weeks, months & years differently - Set the
x-protoblast-webview
request header when running in a webview - Improve Bun v1.x compatibility
- Fix server-side
String#encodeHTML()
stripping out newline & tab characters - Add
Deck#size
property getter
- Add
reset()
method to timebombs - Add
progress_upload
event toRequest
instances made on the browser - Don't let a browser
Request
be considered timed-out while its receiving/sending information
- Add
String.isLetter(character)
method
- Add
Function#instrumentMethod()
to add instrumentation to existing methods
- Add
WeakValueMap
class - Allow
String#tokenizeHTML()
custom blocks to replaceTAG_NAME
states
- Fix
tel:
not being recognized as a valid protocol inRURL
- Add
RURL#matchesPath()
method
- Make
RURL.isUrl()
return true when given aLocation
instance
- Don't add descendants to the dictionary that don't have a
type_name
- Add the
Develry.BackedMap
class - Add
Class#getLiveDescendantsMap()
, which returns a liveBackedMap
that always has the current descendants - Add
BackedMap#getKey(value)
method
- Fix the
Stream
namespace - Make sure
FormData#append(field, value, options)
turns certain values into strings
- Automatically handle
ECONNRESET
errors because of keep-alive requests - Add
Blast.listToTree()
method - Add the
force
argument toBlast.createStaticDefiner(target, force)
- Fix loading invalid extra files causing an error on the client side
- Fix self-closing HTML tags without whitespace not being parsed properly nu
String.tokenizeHTML()
- Throw an error when the value passed to
Date.parseStringToTime()
is not a string or a number - Add
HttpAgent
,HttpsAgent
andAgentPool
class and use them for making keep-alive requests - Add the
SampleCollector
class, which can be used to create rolling averages
- Add the
array()
specifier to signature types - Optimize
String#decodeHTML()
- Optimize
RURL.encodePathSegment()
- Add
size
getter toLRUCache
- Limit the maximum length a string can be for its checksum to be cached
- Optimize function flow implementations
- Allow pledges to remain silent about uncaught exceptions
- Add iterator support to the
Cache
class
- Add ability to programmatically inject code into the client-side script
- Upgrade
json-dry
dependency to v2.0.0 - Add
Blast.createStaticDefiner
andBlast.createProtoDefiner
- Remove
WeakMap
polyfill - Remove
Array#fill
polyfill - Remove old
String
polyfills - Remove
Symbol
polyfill - Clean up string-entities code
- Remove
Blast.uneval
function - Remove the
Function#name
getter polyfill - Remove
String#serializeAttributes()
- Remove
String.randomMac()
- Remove
String#escapeUnicode()
- Remove
Function#listenTo
andFunction#unlisten
- Remove
Object.values()
andObject.entries()
polyfills - Remove
Object.zip()
andObject.unzip()
- Remove
Object.assign()
polyfill - Remove
Array#move()
- Remove
JSONPath
andObject.extract()
- Remove
String#truncateHTML()
andString#fixHTML()
- Remove
String#replaceAll()
polyfill - Remove
String#normalizeAcronyms()
- Add
Deck#clear()
method - Fix returned
Function.parallel()
pledge never resolving in synchronous mode - Add
Blast.stringNeedsHtmlEscaping(str)
method to the server-side
- Fix
RURL
instances parsing single-word hostnames wrong - Rewrite
String#camelize()
to make it 65x as fast - Add
String#decamelize(separator)
method - Rewrite
String#encodeHTML()
to not use regexes - Add
getDescendants()
,getDescendantsDict()
andgetDescendant(name)
class methods
- Make
Request
not use the cache when theget_stream
option is enabled - Add support for methods with signature checking
- Automatically create a
SignatureType
for every created class - Add
Classes
andTypes
to the default module wrapper arguments - Let
Blast.Types
create temporary SignatureType instances on the fly with proxies
- Add
Pledge#is_done
property getter - Add
Array#atLoop(index)
method - Add
Function.makeAbstractClass()
class method - Don't let adding static properties to child classes overwrite existing properties
- Make sure
Object.defineProperty
isn't called with an invalid setter property - Add simple
LruCache
class and use it for caching string checksums
- Fix
Blast.fetch()
breaking whenoptions
argument is present but falsy - Add support for default values to
enforceProperty
- Add some basic Bun support
- Perform a connection check when getting a timeout
- Defuse request timeout bomb on the browser
- Add timeout listener to requests made on the server
- Add
body
property to the Request Response class - Add
url
argument toBlast.fetch()
- Set correct status when a Request times out
- Bind
realNextTick
andrealSetImmediate
on init - Add
Blast.asyncScheduler
symbol which can be used to change the scheduler of function-flow methods - Add
Blast.nextGroupedTick()
andBlast.nextGroupedImmediate()
which will group tasks until the next tick actually starts
- Add
Function.afterConstituted(task)
andFunction.hasConstituted()
methods - Add JSON-Dry support for
Map
andSet
- Add the
HashSet
class - Make
Array.cast()
return array versions ofMap
andSet
instances - Fix
Blast.checksumSymbol
not always being available
- Fix pathnames of a RURL containg unescaped characters
- Add
Array#findAllByPath(path, value)
- Add
Function#setAbstractMethod(name)
- Make server-side requests retry dns lookups if they fail
- Fix
Cache#set()
not setting the MAX_AGE of entries
- Catch
Date#format()
errors regarding unknown timezones in Firefox
- Make
RURL
understand network protocols when assigning hostnames - Fix
Error#parseStack()
capturing wrong line & nr of anonymous function - Fix
Function.setProperty
setting the wrong super property - Try to get more error data from failed
Request
calls
- Fix
Date#secondsToDuration()
using wrong rounded months - Allow scripts loaded with
Blast.require()
to use top-level await - Make
Function.series
andFunction.parallel
throw better errors
- Make sure nothing overwrites the global
JSON
object (which Facebook Pixel currently does)
- Allow custom blocks in
String#tokenizeHTML()
to drop their delimiters from the output - Add line_start & line_end to String.tokenizeHTML() output
- Add line_start & line_end to Function.tokenize() output
- Add
Blast.isFirefox
boolean property - Add
Error.parseStack()
method String#slug()
will now also replace underscores- Add
String#reverse()
method, which works with astral characters - Also add
StringBuilder#reverse()
andStringBuilder#banish()
methods
- Fix DNS cache never resolving pledges
- Fix
Blast.createTempDirSync()
returning the wrong value - Make
Blast.mkdirp()
andBlast.mkdirpSync()
always return the path they were creating
- Add
Request.lookup()
method which caches DNS lookups for 60 seconds - Add more
Request
methods so no externalxhr
access is required - Add
Request
caching - Add
Blast.mkdirp()
andBlast.mkdirpSync()
methods - Add
Blast.rmrf()
andBlast.rmrfSync()
methods - Add temporary files methods:
Blast.generateTempPath()
,Blast.openTempFile()
,Blast.cleanupTempPaths()
, ... - Fix the
String#replaceAll()
polyfill - Fix
TimeoutPledge
not actually running its executor
- Recursively call
clearAndDoTasks()
to make sure new tasks are also called Function.constitute()
will only immediately queue the constitutor when blast has loaded fully, not also when it is loading- Fix
Date#format()
breaking on Safari 14.1 when used with a timezone JSON.safeParse()
will now remove BOM (byte order marker)
- Add some Terser workarounds
- Make
String#replaceAll()
a polyfill, as it is now part of ECMAScript-2021 - Fix inflections of 'criteria'/'criterion'
- Make
Function.enforceProperty
accept symbols as keys - Add the
Branch
class
- Fix static Informer properties
- Fix
classWideEvents
no longer working on Informer instances - Fix
Function.parallel()
not being able to handle promises likeFunction.series()
- Namespace functions will now also have the
.setStatic()
method
- Add all Error classes to the Classes object
- Allow removing all listeners of an informer
- Fix
prepareProperty
andenforceProperty
calls overriding the prototype
Function.inherits(parent, constructor)
now also accepts a name string instead of a constructor- Remove the pre-defined wrapper functions from all the files
- Used named entity-encoding on the server-side
Function.parallel
andFunction.series
will now reject if there is an error in the callback, instead of silently failing- Added
Object.isIterable(obj)
to check for an iterable object RURL.isUrl()
should no longer return true for objects containing just ahref
property- The
body
of aRequest
can now also be set with abody
option property - Fix
RURL#param(name, value)
not parsing form paths - Add some basic timezone support to
Date#format(pattern, locale, timezone)
- Add
Blast.isSafari
boolean & fix detection for iPadOS 13 - Add
Crypto.nanoid(size)
to create a nano-id - Add
Crypto.createNanoidGenerator(alphabet, default_size, rng)
to create custom nano-id generators - Add
SeededRng#randomBytes()
so it can be used as an rng in the nano-id generator
- Make
String#tokenizeHTML()
ignore illegal nested custom blocks - Allow
String#tokenizeHTML()
to ignore blocks that span multiple lines
- Add
String#dedent()
method - Add
deprecate
decorator - Add sourcemap support
- Fix error in
Function.parallel
&Function.series
where primitives would be turned into objects RURL#segments
will now no longer contain empty strings- Add
RURL#isDescendant(parent)
to see if the current path is a descendant of the given path
- Automatically create the prototypal wrapper methods for the function inheritance
Function#setProperty
now accepts a single object to set multiple properties- Add
Stream.Delayed()
class - Add
Stream.Combined()
class - Fix browser-side
Crypto.randomHex()
returning faulty data - Supplying
@
as a namespace will put it in the root - Add server-side
FormData
class - When reporting
Pledge
progress, the duration of each interval is also logged - Make the
reset_on_call
option ofFunction.throttle
actually work - Pledge subclasses will return a regular
Pledge
on.then()
- Add
Pledge.Timeout
class - Add
String#splitCharacters()
for getting an array of the string's characters - Add the
loopOverArgument()
decorator, which will loop over the given argument if it's an array - Add the
empty
event to FunctionQueue - Add the
RURL#extension
property to get/set the extension of the pathname RURL#pathname
will now no longer be empty when the protocol requires a slash- Add a custom
Error
class - Add
Function.isNativeClass()
to detect functions made with nativeclass
syntax - Added
Symbol.hasInstance
trap to the namespace functions - Use
setImmediate
for rejecting Pledges to prevent uncaught warnings - Fix
Blast.versions
entries not being set correctly
- Bumped node.js version requirement to at least v8.9.0
- Added
Blast.parseUseragent(ua)
method - You can now add files with
Blast.require()
and specify specific browser versions - Add
Blast.checksumSymbol
properties to serveral protoblast objects - Add
modify_prototypes
option to the client template - You can now also override the rejection error when using
Function.series
orFunction.parallel
String#encodeHTML()
will no longer encode newlines- Only report Pledge progress when #report_progress is truthy
- Add
Protoblast#version_string
property, use it to add to the#loaded_versions
property RURL
should keep slashes when no protocol is givenFunction.enforceProperty
will already add the used symbol to the prototype- Make
String.decodeAttributes()
decode tag attributes by default (no separator) - Fix
Date#timeAgo()
returning big hours, minutes & seconds when date is more than a month ago - Make
Array#sortByPath()
handle comparingundefined
and objects better - Passing
headers
option toRequest#setOptions()
will no longer unset earlier headers - Add
RegExp.interpretWildcard(str, flags)
- Add some tweaks to
Function.tokenize
so it'll recognize regular expressions better - Fix
Object.walk
throwing an error when handlingObject.create(null)
objects - Add more easing methods to the
Math
object - The
State
class will no longer turn off-line when a stale request times out - Rename
State#online_status_duration
property toState#current_status_duration
- Abort xhrs made by
Request
when a timeout occurs - Add
delay
option toFunction.throttle()
to always enforce a minimum delay - Passing a single object to
RURL#param()
will now set the key-values as parameters - Add detection for Electron, like Nwjs
- Add some infinite-loop prevention to
Function.enforceProperty
setter/getters Request
now has amax_timeout
property that defaults to 30 seconds, instead of a hardcoded 8 seconds- Remove the
__enumerate
trap from the Magic class - Added
Pledge.done(promise, callback)
as a static method - Add
time_started
andtime_ended
properties to theRequest
class - Add
Array#safesort()
, which won't throw an error when sorting Objects with no prototype - Don't trust the
type
property of an XMLHttpRequest'sresponse
object - Add locale support to
Date#format()
- Add
cast
argument toString#assign()
method - Speed up the
String#underscore()
method String#decodeJSONURI()
will now only try to decode JSON if it contains certain json characters- Remove the
Array#createIterator()
method as it breaks CKEditor - Add
Date.secondsToDuration()
- Add
Date.firstWeekOfYear(year)
&Date.firstDayOfWeek(year, week)
- Allow retries of
Blast.getClientPath()
- Add
Request#download_if_inline
boolean option - Add the
StringBuilder
class - Allow passing another pledge instance in
Pledge#done()
- Add
Pledge.isThenable()
andPledge.hasPromiseInterface()
- Add
Pledge.cast()
to turn something into a pledge
- Add
String#allIndexesOf(needle)
to get an array of indexes - Speed up
String#tokenizeHTML(source)
when supplying custom blocks - Add
Function#enforceProperty(setter)
- Add
Blast.requireAll()
to require multiple files with the same options - Allow parent classes to override a child constructor with
modifyChildConstructor
function - Add simple
Magic
class, which supports Magic getters & setters by using proxies - Add
Blast.parseUseragent(ua)
to parse a useragent string
- Fix
Function#throttle()
not throttling enough becausesetTimeout
fires too soon - Add
String#isUpperCase()
andString#isLowerCase()
- Add
ignore_arguments
option to thememoize()
decorator - Add
Object#zip(keys, values)
andObject#unzip(obj)
- Add
Blast.checksumSymbol
you can use to define a method that replaces the parameter of aObject.checksum(obj)
call - Make
Date.parseString()
understand regular date strings - Make
Function.contitute(fnc)
schedule the function usingBlast.queueImmediate()
if Blast has already been loaded - Make the internal
queueImmediate
,queueTick
methods asynchronous even after Blast had loaded Blast.doLoaded()
will now also work after Protoblast has already loaded once- Allow passing a regex into
RegExp.interpret()
- Add a
main_class
getter to namespaces - Add
String#countCharacters()
to count characters, including emojis - Make
String#count()
useString#countCharacters()
when empty string is given - Add
String#substrCharacters(begin, length)
to get a substring of the actual characters - Add
String#substringCharacters(begin, end)
- Make
String#truncate()
honour emojis - Add HTML tokenizer based on the original
String#stripTags
method - Truncate HTML strings with help from the tokenizer
- Fix the server-side
Request
class implementation - Fix
Pledge
instances executing the callbacks synchronously - Fix
Cache#has(key)
return true for expired entries - Fix
memoize
Decorator not settingmax_age
whenignore_callbacks
is true - Add
cast
argument toArray#unique()
Pledge#_started
is now a timestamp, not a boolean- Add duration properties to the
Pledge
class - Add
Blast.REPLACE_OPEN_TAG_NEWLINE
symbol for use inString#stripTags()
- Add
Deck#remove(key)
method - Fix
String#romanize()
stripping diacritics before being able to replace them - Add support for double diacritic characters to the
String#diacriticRegex()
- Fix server-side
Request
not handling redirect properly - Fix
Date.parseStringToTime(str, base)
not parsing base strings properly
- Add
RURL#usedBaseProperty(name)
to find out if a property came from the base location - You can now use
Date#startOf(unit)
to set dacesecond & decaminute Function.series
will now pass the value from the previous task to the next- Add
LazyPledge
class, which will only call on the executor oncethen
has been called - Forward Pledge progress reports to other pledges
- Add
Blast.isWebview
to detect when it's running in a webview - Use
requestIdleCallback
as asetImmediate
implementation in the browser - Make
Informer#emit()
exit early when no listeners are found - Rewrite setImmediate polyfill
- Add
Date#timestamp
getter - Add
flag
parameter toObject.path(flag, obj, path)
- Add
Blast.PATH_AGGREGATE
flag - Add flag support to
Array#sortByPath()
- Rewrite
String#stripTags()
, based on Eric Norris implementation
- Add State class
- Add
RURL#seems_valid
property - Rewrite
Request
class & add browser support Function#throttle(fnc)
now accepts a config object as second argumentFunction#throttle(fnc, config)
can now be used in classes- Add
throttle
method decorator - Add
Blast.requestIdleCallback
implementation - Removed japanese & hebrew
romanize
string methods - Removed
Function.curry
function - Upgrade json-dry dependency to 1.0.8
Informer#forwardEvent()
now accepts a single event emitter to forward ALL events to- Make
Blast#setImmediate()
throw an error if the callback argument isn't a function Function.setMethod()
will useObj.getPropertyDescriptor
to check existing methods, so no getters are accidentally triggered- Fix inheriting from a namespace when it is not yet available
- Make
Pledge
polyfill forPromise
- Add
Pledge.after(n, val)
, which returns a pledge that resolves after n milliseconds - Add
Pledge#race(other_pledge)
- Add new
Array#findByPath(obj)
signature - Add
Object.sizeof(input)
to get the size of a variable in bytes - Add
Cache
class - Allow passing a descriptor to
Blast.defineValue
- Add
Function#decorateMethod(decorator, key, method)
- Add
Date#timeAgo(settings)
method Object.checksum()
will only checksum a function's source string- Add
Blast.Decorators.memoize
decorator - Make
Pledge#handleCallback()
an alias ofPledge#done()
Object.checksum(mixed)
will now treat Dates & Numbers differentlyObject.checksum(mixed)
will now correctly hash node Buffers- Add
Buffer
support toObject.alike(a, b)
- Make
Object.alike(a, b)
not sort arrays when doing a checksum - Fix
Object.alike(a, b)
treating null as regular objects - Add a very basic Symbol polyfill for IE11
- Add
Blast.alikeSymbol
property, whichObject.alike
uses for comparing likeness
- Add
Function.doConstitutors
to force doing the constitutors of a class - Add
sort_arrays
parameter toObject.checksum(obj, sort_arrays)
- Fix
Object.formPath
andObject.setFormPath
not finding correct RURL methods - Add
limit
support toFunction.forEach.parallel
- Add
String#isEmptyWhitespace()
to test if the string is empty or has only whitespace - Add
String#isEmptyWhitespaceHTML()
to test if the string is empty or has only whitespace, including HTML elements
- Setters & getters defined with
setProperty
should now also get asuper
property Object.flatten(obj, divider, flatten_arrays)
now takes a third argument that enables you to disable flattening arrays- Upgrade json-dry dependency to v1.0.5
- Added new operators & keywords to the function tokenizer
- Add
Date.parseDuration(str)
for getting a duration in ms Date#add
andDate#subtract
now also accept duration strings- Total
RURL
rewrite, inspired byurl-parse
by Arnout Kazemier andURI.js
by Rodney Rehm Object.flatten(obj, divider)
now accepts custom dividersRURL.encodeQuery(obj)
now handles nested objectsString#assign(values, remove_used)
attempts to normalize values when assigning objects- Add
Date.parseString(str, base)
andDate.parseStringToTime(str, base)
- Add
Pledge.resolve
andPledge.reject
Function.parallel
andFunction.series
now accept an array of Pledges/Promises- Add
Pledge.all
support & some more rejection fixes - Add
Pledge.race
and make it so a Pledge's state can't change - Make
Pledge
class global (if allowed) - Add
String#startsWithAny
andString#endsWithAny
- Add
Object.values
andObject.entries
polyfill
- Fix some reserved words
- Fix
URL#parse
not working on node v10 - Change name of the URL class to RURL, also store under Blast.Classes.URL, because the new URL class is crap anyway.
Function.regulate
returned wrappers now have acall_count
property
- Add
overflow
task toFunction.regulate
which will receive extra calls Object.first
will returnundefined
if it is given an empty object- Fix benchmark coverage tests
- Fix redefining read-ony
URL.prototype
in NW.js & browsers - Fix setting undefined
clearImmediate
function - Added
String#repeat(count)
polyfill - Add
String#padStart
andString#padEnd
polyfills - More already-loaded-version workarounds
- Fix prototype pollution in
Object.merge
- When a
next
method ofFunction.parallel
orFunction.series
is called multiple times an error will be thrown Informer#setCacheMethod
will no longer try to execute a callback if it's not defined- If the argument for
Pledge#handleCallback
is truthy but not a function, an error will be thrown - Throw an error when a
Pledge
is resolved with itself - Fix the way
Pledge
handles rejections - Add
Pledge#addProgressPart(parts)
andPledge#reportProgressPart(parts)
to facility progress reporting
Function.regulate
will throw an error if no function is givenBlast.require
'd files will now be added to the client script- All files required by Blast are now loaded using
"use strict";
- Fixed many strict errors
- Setting
module.exports
in a Blast file function will have the expected result (when usingBlast.require
) - A
Pledge
will now throw anError
if there are no rejection listeners for it - Added
Pledge#silentReject
which won't throw anError
in case there are no rejection listeners - Add context setting as the second parameter to
Blast.nextTick
andBlast.setImmediate
- Removed
Blast.setTimeout
- Pass the
seen
object toBlast.alikeSymbol
methods
- Use
Promise.resolve()
based solution for browser-sidenextTick
implementation (50x faster than using anImage
error) - Add support for using Protoblast in a WebWorker
Object.divide
will return arrays unchanged- Added
RegExp.isRegExp
Object.setPath
will now no longer replace functions with objects- Class namespaces are now functions themselves, will return the class of the same name in the namespace if called
- When inheriting a class that does not yet exist, the static properties of the main namespace class will already be added to the new constructor
- Make sure constitutors added during the
doLoaded
phase are executed - Add
Pledge#handleCallback
which will handle old-style callbacks - Added some more NW.js fixes
JSON.dry
will no longer addnamespace
ordry_class
properties iftoDry
has already set themJSON.undry
will now accept a dried object that has been parsed using regularJSON.parse
(this is faster than re-stringifying & undrying it)- Fixed the space problem in
JSON.dry
Object.walk
will now return an object with all the seen objects and a weakmap containing the seen countObject.walk
can now be called without a task function- If DRY references to a value has a shorter path, use that in the future
- From now on,
json-dry
is its own package once again - Added
JSON#toDryObject
, an alias forDry.toObject
- Certain characters in URL queries will no longer be encoded, like brackets
String#encodeHTML
now correctly encodes characters with 2 codepoints (emojis)- Fix Crypto on IE11
- Rewrote
Object.exists
to useObject.path
- Fix
URL#toString
: hashtags now include the actual#
- Use the
innerText
method on browsers to decode HTML entities - The big HTML entities map is no longer needed on the client side, so it is a normal uncompressed javascript file again
- Fix
Function.timebomb
to actually set theexploded
property - Enable cutting out code for the client side
- Remove the string compression code
Array#max
andArray#min
now also accept a path- Static methods are now also set on the
Bound
objects - Added
Object.parseDotNotationPath
to turn a path string into an array - Added
Array#modifyByPath(path, fnc)
- Use
Buffer.byteLength
to calculateContent-Length
headers - The
Pledge
returned byFunction.parallel
andFunction.series
will now be resolved with the return value of the callback, if any
- Added
Pledge
class, which is a type ofPromise
Function.parallel
now returns aPledge
instanceFunction.create
now also sets the wrapper arguments, so thelength
property matches- Added
Informer.setAfterMethod(filter, key, method)
, which is a method that will prevent execution until it has seen the given filter (string or object) - Fix crash when using recursive objects on
Object.alike(a, b)
Array#flatten
will now preserve the perceived order- Add support for other HTTP methods in
Request
- Add experimental
Informer.setCacheMethod
function - Remove the
#toSource()
methods Benchmark
should now calculate correct overhead cost on node 8.x
- Fix
String#fowler()
checksum generation - Fix
String#numberHash()
, it's now slower thanString#checksum()
but still faster thanString#fowler()
Object.checksum
will now split strings in 2 for checksuming, this decreases collisions without affecting speed- Use same collision improvement in
Object.checksum
on objects, arrays & regexps. String#checkum
now accepts astart
andend
parameterInformer#queryListeners(type, mark_as_seen)
will now honor themark_as_seen
parameterInformer#hasBeenSeen
should now also work when no listeners have been attachedInformer#unsee
will now also accept filter objects- Added
FunctionQueue#force(fnc, args, options)
which will forcefully run the given function on the queue, even if the limit is reached. - Made
FunctionQueue
run more asynchronous whenadd
-ing offorce
-ing after it has already started
String.encodeCookie
will useencodeURI
for the path & domainFunction.methodize
should set the original function as the unmethodized oneFunction.unmethodize
should set the original function as the methodized one
- Add
Function.isNameAllowed(name)
which checks if a name is allowed - Added very basic
WeakMap
polyfill - Add
Function.getArgumentNames
- Allow ability to add Function driers
- Added
Number.isNumeric(input)
Array#sortByPath
will now interpret numbers as new directions- Added
Array#findByPath(path, value)
URL#addQuery
will no longer iterate over non-plain objects- Add
limit
parameter toObject.walk
to limit the recursiveness - Add
String#splitOnce
andString#splitLimit
- Fix
Function.inherits
not adding static methods on time - Fix
Math.removeOutliers
so it isn't too generous - Add
String#splitOnce(separator)
andString#splitLimit(separator, times)
- Added
Object.isSelfContained
, which returns true in case of Date, RegExp, String objects, ... Object.merge
will now treat RegExps and Dates as a single variable, and not as an object that also needs to be merged- Added
Math.calculateDistance
to calculate the distance between 2 sets of coordinates - Added
Array#shuffle
, which shuffles an array in place - Added
SeededRng
class for random numbers that repeat - Added
get_stream
option toRequest#http_request
, which returns the correct output stream (sameres
object orgzip
) instead of the body Blast.fetch
is now also available in the browserObject.isPlainObject
will now return true for objects without a prototype- Redirected requests will no longer fail when being redirected to a path without hostname
String#fowler
should now produce correct hashes- Make
Crypto.randomBytes
return an Int8Array in the browser
- Inheritance schedule fixes
- Fix URL class in Cordova
- Added
Blast.isEdge
to detect and fix Edge issues - More attempts to fix the URL class in IE/Edge
- Fix multiple inheritance shallowly inheriting second parent
JSON.undry
will now parsenull
strings correctlyFunction.throttle
has a new parameterreset_on_call
, to delay execution as long as it's being called on.- Classes will now constitute in an expected order. Classes that inherit a not-yet-existing parent won't be pushed to the end of the queue anymore.
Object.size()
will now always return a numberObject.size()
will now also work on RegExp and Date objects- The
Request
class will callback with an error for status codes >= 400 - Added
Number#formatMoney(decimal_count, decimal_separator, thousand_separator)
- The
Function.thrower
dummy callback will no longer throw falsy values
- Fixed
String#endsWith
so empty strings will return true - Make
String#endsWith
andString#startsWith
shims - Protoblast with complain about overwriting properties when in debug mode
- Fix bug in
Object.checksum
usingvalueOf
on an object without prototype - Fix constructors not getting static methods when in non-native-modifying mode
- Fix:
unmethodize
andmethodize
shouldn't get stuck in a loop because of the function name - Test: creating an anonymous function is a bit harder in new node versions
- Improve
Object.alike
performance and add tests - Added 4th parameter to
Function.inherits
that skips constitutors when falsy - Fixed bug where constitutors would be executed twice for delayed inheritance
- Add
String.decodeAttributes
JSON.dry
now also honours thespace
parameter
asyncLoop
functions (like Function.while) will now execute test and task function in the same tick, in stead of first checking the test, then doing the task on the next tickObject.checksum
no longer skips undefined values in objects- fix: child classes with a different namespace than the parent are now actually stored in that namespace
String#decodeHTML()
should now handle hexadecimal entities properly- Make sure an Object has the
hasOwnProperty
method before using it in JSON-Dry Object.checksum
should also checksumize RegExps correctlyRegExp.interpret
now also accepts flags as second parameter- Decompress HTML entities on-the-fly
- Fix protoblast version bug
- Add static
Number.calculateNormalizeFactors
andNumber.normalize
methods - Add
Math.removeOutliers(arr)
which returns a new array without outliers - Add
Number.denormalize
- Added
Informer#unsee
method, so 'after' and such can be reset - Added
Number#bitAt
method, to return the bit at the specified position Array#clip
'highest' value is now optionalArray#employ
has been removedFunction.benchmark
will now calculate overhead based on self-created dummies- If another Protoblast instance is detected during loading, it will only be returned if the major & minor version is the same and the patch is higher. Otherwise, a new instance is created. This is only the case in the non-global-modifying mode.
- Add
queue_drop
option to FunctionQueue, which will limit amount of items in a function queue by dropping older added tasks - Add
Array.likeArray
to determine if an object is like an array Object.dissect
will only add numeric array properties to the result- Added
Blast.setTimeout
andBlast.setSchedule
for more precise timers - Add
String.randomMac
to generate a random mac address - Add
Function.getNamespace
to get/create a namespace object Blast.DEBUG
is now true if there is a DEBUG environment variable
- Minor version bump because of added namespaces to
Function.inherits
JSON.clone
will now also look for#dryClone(wm)
and#clone()
methodsJSON.clone
second parameter is an optional method name to use for cloning- Fix bug in
JSONPath
String#fillPlaceholders
can now remove used values from the given object- Add
Date#setTimestring
to set the time in order of '12:00:00' - The date 't' format should now return the number of days in the given month
- Added
JSON.safeParse
Function.hinder
can now call pushed tasks with an error and other datatoDry
methods no longer need to return a 'path' property for undrying- When the function passed to
Object.walk
returns false, it won't recurse - Added
Object.getPropertyDescriptor
, which will look for a descriptor up the prototype chain - Getter and setter functions will now also receive a
super
property reference to the function they're overriding Function.setStatic
properties can now be overwrittenFunction.setStatic
can now optionally not be inherited- Add
Blast.createObjectId
for the browser - Checksumming a null value won't throw an error anymore
Object.merge
should now correctly assign objects over primitive values
- Begin adding NW.js support
Date#format('L')
now returns a boolean instead of a string- Always modify prototypes of classes made by Protoblast itself (URL fixes)
String#slug
now removes diacritics and separator repeats- Improve
Object.merge
, still not ready for release though - Add
getChildren
method to class functions - Make class constitutions happen in order (child constitution would happen before the parent's)
- Don't use broken URLConstructor objects on legacy browsers
Array#include
now appends when no index is givenDate.create
now accepts a valueDate.difference
now usesDate.create
instead ofnew Date
Array#include
correctly handles single argument- Added
Object.first
- Use
#valueOf()
when getting object checksums, fixesDate
instances getting the same checksums - Add
String#fixHTML
andString#truncateHTML
- Fix JSON-dry special char bug
- Decode HTML when slugifying a string
- Improve
Object.setPath
- Add
Object.formPath
andObject.setFormPath
JSON.clone
is now much more performant than the old method- Properties set on a Deck instance now also get JSON-dried
- Fix pushed tasks in
Function.hinder
object
- Add
Blast.loaded
, which will execute after initial scripts have finished Function.constitute
will still execute ASAP, but usingBlast.loaded
Array.cast
will handle select elements properly from now onJSON.dry
uses JSON-js from now on, sotoDry
can come beforetoJSON
- Add
JSON.registerDrier
andJSON.registerUndrier
- Add link to homepage http://protoblast.develry.be
- Add FunctionQueue#destroy()
- FunctionQueue's throttle & limit functionality now can be combined to execute functions in batches
- Object#path doesn't split individual arguments anymore
- Added Function.throttle(fnc, ms, immediate)
- FunctionQueue's will only be sorted when dirty
- Bugfixes in non-global mode
- Class constructors now have a
children
array property, with direct descendants only - Static class properties are now also added to already existing children
Object.setPath
now also creates arrays when encountering numeric keysInformer
properties are still created when first requested, but no longer withObject.defineProperty
- Fixed bug where FunctionQueue's lastEnd time was not being set
- Added Function.forEach.parallel
- Added Informer#forwardEvent
- Added Math.lowpass and Math.interpolate
- Added Math.plotdate and Date.difference
- Make it possible to set class-wide event listeners
- Add tryCatch function
- Informer event functions now also have a reference to the original context under the 'that' property
- Object.isPrimitiveObject checks if constructor exists before getting its name
- Object.checksum handles circular references from now on
- Add FunctionQueue class, which can be created through Function.createQueue()
- Add throttle & sorting to the FunctionQueue
- Fixed event listeners stop() context function
- Add option to capitalize each word when using String#titleize
- Function#prepareProperty now passes along a function to the given setter which queues given functions to run after the property has been set. This happens synchronously (otherwise setImmediate should be used).
- Function inheritance now uses nextTick instead of setImmediate
- Add Object.walk, the recursive version of Object.each
- Object.hasProperty should no longer fail on non-objects
- Allow 'Infinity' for cookie expires & maxage values
- Add JSON.clone, to quickly clone something using regular JSON
- Fix JSON.dry, had problems with the chain when using toJSON
- Fix: Function.doUntil runs while the test is falsy, not truthy
- Add Function.regulate and Function.count, improve String#encodeHTML
- Make sure Function.series does not fire the callback multiple times
- Modify Array#unique to allow a path be checked for duplicates
- Add Array#sortByPath to save the user from writing unwieldy sort functions
- Add the wrapper created with Function.create to the source function
- Add Informer.isInformer & Iterator.isIterator static methods
- Add Math.overlaps() to see if 2 ranges overlap
- Add String#normalizeAcronyms, which removes dots from acronyms
- Everything is now defined with
configurable
andwritable
set to true - Added Array#include and Array#flatten (which behaves differently then Object.flatten)
- Turned URL#toString into a shim
- Added Array#employ, for when Array#map is too verbose
- Added Function.until, .doUntil and .while (sharing code with .doWhile)
- BUGFIX: String#dissect will no longer throw an error on empty strings
- Added Function.benchmarkCSSRule for the browser
- Added Function#setProperty, for property getters & setters
- Added Function#prepareProperty, which sets the value through a getter on first get, and removes the getter after that
- Added Function#setStatic methods
- Added Object.inject (assign for non-enumerables) and multiple inheritance
- Allow Deck to return sorted arrays without cloning (slicing) them
- Improve performance of Object.hasProperty
- Extended classes also inherit static properties (but do not share instances)
- Extended classes are also saved in Blast.Classes
- Function.inherits now allows strings. If the given class name isn't available yet, it will be extended once it is.
- Added String#controllerClassName and String#modelClassName
- Add Date#stripTime and Date#stripDate
- If an Informer event is emitted and the last argument is a function, it will always be seen as a callback. If you just want to emit a function a null will have to be appended
- Informer listeners can now have a context attached
- Add Deck#clone() method
- Add Deck#has(key) method
- Deck#get(key, def) now can set the key's value if it has not been set yet
- Add Deck.create() static method
- Add Object.setPath({}, path, value)
- Add JSON.dry and JSON.undry (circular & reviver support)
- Add String#assign and String#assignments
- Add Iterator#reset, to go back to the beginning
- Deck now implements the ES6 iterator protocol by inheriting our Iterator class
- Function.parallel now also has a non-async mode
- Add Function.hinder, which executes a worker and only afterwards executes other tasks added to it
- Add Function.thrower, a dummy function that can throw an error
- Add static String methods: encodeURI, decodeURI, decodeJSONURI, decodeCookie
- Add basic Crypto class, for generating UIDs
- Add Function.timebomb(timer, callback)
- Add String#fowler, which generates a fnv1-a hash
- Add Date methods to simplify date manipulation
- Add Date#format method
- Add Function.forEach method
- Added Array#sum(property, map)
- Math.deviation should actually have been 'standardDeviation'
- Added the correct Math.deviation
- Math.variance has been modified, now accepts second parameter for bias
- Added a (fast!) Math.pearson correlation score function, based on Matt West's [email protected] original function
- Added Math.spearman
- Added Array#flashsort() for faster sorting
- All Math functions that need sorting now use flashsort
- Added Math benchmarks
- Added clipping functions to Number, Array and Math
- Added Object.size(variable)
- Added String#slug()
- Fixed lots of bugs in Function.series and Function.parallel
- Fixed all
arguments
leaks, greatly improving performance - Fixed IE bugs, added Function#name getter for IE
- Added Selenium/Saucelabs testing
- Blast.defineValue can now take an array of names to assign same value to multiple properties
- Added Informer class, an advanced event emitter based on HawkEvents
- Added URL class (for node.js & IE9) + URL.parse()
- Added Blast.inherits function, like node's util.inherits
- Added Object.checksum and Object.alike
- Informer can now handle async events
- Added RegExp.execAll
- Function.series forces asynchronicity by default (by using setImmediate), but if wanted this can be disabled by passing a boolean false as first arg
- Added shim for ES6's Array#fill(value, start, end)
- Added Function.inherits, Function#extend and Function#setMethod
- Added shim for ES6's String#codePointAt(position)
- Fixed typo in variable name in flashsort
- Added String compression, using Pieroxy's original lz-string
- Added String#escapeUnicode(), to get the complete escaped string
- Removed the HTML Entities from the string_entities script file, and added a (compressed) file called 'string_compressed_entities.js'
- Added Array#insert(index, value, ...)
- Added Object.hasProperty(obj, propertyName)
- Added String#truncate(length, word, ellipsis)
- Added String#stripTags()
- Added Date.isDate(variable)
- Object.path(obj, path) now also accepts an array or multiple arguments
- Add Array.range(start, stop, step) method, which behaves like Python's range()
- Add Array#closest(goal) method to find the closest value to the given goal
- Added String#before(needle, first) and String#after(needle, first)
- Added String#beforeLast(needle) and String#afterLast(needle)
- Added Object.isObject(obj)
- Added Object.isPlainObject(obj)
- Added Object.isPrimitiveObject(obj)
- Added String.serializeAttributes(obj)
- Added String#encodeHTML and String#decodeHTML
- Added Object.flatten(obj)
- Added Array#unique()
- Added Function#curry()
- Added Iterator class and Array#createIterator()
- Added Deck class (ordered object)
- Added unit tests for Iterator & Deck
- Added String#dissect(open, close)
- Added RegExp.interpret(pattern)
- Added RegExp#getPattern()
- Added RegExp#getFlags()
- Added RegExp.combine(r1, r2, ... rn)
- Added Function#tokenize(addType, throwErrors)
- Added Function.tokenize(source, addType, throwErrors) and Function.getTokenType(str)
- Added JSONPath, added Object.extract using that class
- Added Number.random(min, max)
- Speed up String#count and add String#replaceAll that doesn't use regexes
- Added Math methods: mean, median, variance and (standard) deviation
- Started adding Benchmarking functions
- Added (asynchronous) function flow controls
- Added Number#humanize method
- Update inflection rules (Ben Lin's From node.inflection, https://github.com/dreamerslab/node.inflection)
- Added basic client-side support
- Added toSource methods
- Added Object.uneval support (also in Protoblast.uneval)
- Added unit tests
- Moved code from Alchemy MVC
- Added RegExp, Number and Function blasts