Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
metarhia-common
Advanced tools
Namespace: api.common
in Impress Application Server
$ npm install metasync
common.splitAt(index, array)
index
- index defining end of first part and start of secondarray
- Array which is splittingcommon.isScalar(value)
value
- scalar value or Objectcommon.copy(ds)
ds
- Array of objects (source dataset)common.clone(obj)
obj
- Object or Arraycommon.duplucate(obj)
obj
- Object or Arraycommon.getByPath(data, dataPath)
data
- ObjectdataPath
- String (dot-separated path)common.setByPath(data, dataPath, value)
data
- ObjectdataPath
- String (dot-separated path)value
- new valuecommon.deleteByPath(data, dataPath)
data
- ObjectdataPath
- String (dot-separated path)common.merge(array1, ..., arrayN)
...args
- arrayscommon.subst(tpl, data, dataPath, escapeHtml)
tpl
- template bodydata
- global data structure to visualizedataPath
- current position in data structureescapeHtml
- escape html special characters if truecommon.htmlEscape(content)
content
- String to escapecommon.fileExt(fileName)
fileName
- String, file namecommon.removeExt(fileName)
fileName
- String, file namecommon.spinalToCamel(name)
name
- Stringcommon.escapeRegExp(s)
s
- Stringcommon.newEscapedRegExp(s)
s
- Stringcommon.addTrailingSlash(s)
s
- stringcommon.stripTrailingSlash(s)
s
- stringcommon.dirname(filePath)
filePath
- Stringcommon.capitalize(s)
s
- Stringcommon.between(s, prefix, suffix)
s
- source stringprefix
- substring before needed fragmentsuffix
- substring after needed fragmentcommon.removeBOM(s)
s
- string possibly starts with BOMcommon.arrayRegExp(items)
items
- array of stringscommon.isTimeEqual(time1, time2)
time1
- time string or millisecondstime2
- time string or millisecondscommon.nowDate(now)
now
- date Object (optional)common.nowDateTime
now
- date Object (optional)common.omap(mapFn, obj)
mapFn
- funtions applied to every field valueobj
- object which fields used for mappingcommon.compose(fn1, ..., fnN)
...fns
- functionscommon.maybe(fn, defVal, value)
fn
- functiondefVal
- default valuevalue
- value (optional)fn
or defVal
common.zip(arrays)
...arrays
- input arrayscommon.replicate(count, elem)
count
- new array lengthelem
- value to replicatecommon.zipWith(fn, arr1, ..., arrN)
fn
- function for zipping elements with index i...arrays
- input arrayscommon.curryUntil(condition, argsI, argsParts, fn, ...args)
condition
- function(argsI, argsParts) returns booleanfn
- function which will be curried...args
- arguments for fncommon.curryN(fn, count, ...args)
fn
- curried functioncount
- number of times function should be curried...args
- arguments for first curryingcommon.curryTwice(fn)(args)
fn
- function to be curriedcommon.curry(fn, ...args)
fn
- function...args
- argumentscommon.applyArgs(...args)(fn)
...args
- arguments to save in closurecommon.either(fn)
fn
- function to be calledfn
common.falseness()
common.trueness()
common.emptiness()
common.nop(callback)
callback
- callback to be called with (null)common.noop(empty, callback)
empty
- incoming value to be ignoredcallback
- callback to be called with (null, null)common.cb(callback)
callback
- function (optional)common.cbExtract(...args)
common.falseness
args
- argumentsfn.inherited
common.override(obj, fn)
obj
- Object containing method to overridefn
- function, name will be used to find methodcommon.range(from ,to)
from
- range startto
- range endcommon.sequence(seq, max)
seq
- Arraymax
- optional maxcommon.random(min, max)
min
- range startmax
- range endcommon.shuffle(arr)
arr
- arraycommon.eventEmitter()
common.restLeft(fn)
fn
- (args, arg1..argN, callback) to (arg1..argN, ...args, callback)fn
common.duration(s)
s
- string in duration syntaxcommon.bytesToSize(bytes)
bytes
- int sizecommon.sizeToBytes(size)
size
- string sizecommon.ip2int(ip)
common.localIPs()
common.parseHost(host)
host
- host or empty string, may contain :port
common.longDivModBE(buffer, divisor)
buffer
- Buffer containing a dividentdivisor
- a divisor as a Numbercommon.generateKey(length, passible)
length
- key lengthpossible
- string with possible characterscommon.generateGUID()
common.generateSID(config)
config
- structure { length, characters, secret }common.crcSID(config, key)
config
- structure { length, characters, secret }key
- SID (key)common.validateSID(config, sid)
config
- structure { length, characters, secret }sid
- session id stringcommon.hash(password, salt)
password
- Stringsalt
- Stringcommon.validateHash(hash, password, salt)
hash
- Stringpassword
- Stringsalt
- Stringcommon.sortComparePriority(priority, s1, s2)
priority
- array of strings with prioritys1, s2
- comparing stringscommon.sortCompareDirectories(a, b)
a, b
- comparing stringscommon.sortCompareByName(a, b)
a, b
- objects { name }
to comparecommon.cache()
FAQs
Metarhia Common Library
The npm package metarhia-common receives a total of 4 weekly downloads. As such, metarhia-common popularity was classified as not popular.
We found that metarhia-common demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.