Skip to content

Latest commit

 

History

History
152 lines (146 loc) · 10.6 KB

File metadata and controls

152 lines (146 loc) · 10.6 KB

API Function Index

README -> API Index -> Function Index

Function pages are grouped by module.

Modules

  • lib._boot
    • install - Install normalized environment metadata onto lib._env.
    • resolveRoot - Resolve the best-available root object.
  • lib._http
    • get - Issue a simple async request (default GET) with callback dispatch.
    • post - Convenience POST wrapper over _request.
    • request - Issue a configurable async request.
  • lib.args
    • parse - Parse a positional argument list into a hash.
    • slice - Slice an arguments-like object into a real array.
    • isArguments - Determine whether a value is an Arguments object.
  • lib.array
    • append - Wrap each item in input with a prefix and postfix.
    • subtract - Return a copy of list with all values in exclude removed.
    • trim - Normalize a value into an array and trim whitespace from string elements.
    • is - Check whether a value is an Array.
    • to - Coerce any input into an array.
    • len - Return array length, or 0 if not an array.
    • filterStrings - Normalize an input into an array of non-empty strings.
  • lib.bool
    • intentTrue - Detect affirmative intent.
    • intentFalse - Detect negative intent.
    • is - Is the value a real boolean (true or false)?
    • isIntent - Does the value explicitly encode boolean intent?
    • to - Strict boolean conversion.
    • byIntent - Intent-based boolean conversion.
    • hasIntent - Alias of lib.bool.isIntent.
    • ish - Alias of lib.bool.isIntent.
    • yes - Alias of lib.bool.intentTrue.
    • no - Alias of lib.bool.intentFalse.
  • lib.func
    • name - Attempt to retrieve immediate caller info from the stack.
    • wrapper - Wrap one function with post-applied arguments.
    • postWrap - Wrap a function chain with post-applied arguments.
    • preWrap - Wrap a function chain with pre-applied arguments.
    • get - Resolve a function target.
    • parseList - Parse a compact function-list DSL into normalized call records.
  • lib.hash
    • get - Safely get a nested value from an object using a dot-path.
    • set - Set a deep property on an object using a dotted path, creating missing intermediate objects as needed.
    • legacySet - Legacy non-destructive dotted-path setter.
    • expand - Expand a list of property paths from an object into an array of values.
    • to - Coerce any input into a hash (plain object).
    • is - Determine whether a value is a plain hash object.
    • hasKeys - Check that an object has all of the given keys / paths.
    • append - Shallow key/value decoration helper.
    • merge - Deep merge two plain hashes (non-destructive).
    • mergeMany - Merge a list of hashes left-to-right.
    • flatten - Flatten a nested hash or array into a shallow key/value object.
    • inflate - Inflate a flat hash of key/value pairs into a nested object.
    • exists - Check whether a deep property path exists.
    • strip - Deep-strip unwanted values from a hash/array structure.
    • filter - Filter an object or array by predicate.
    • getUntilNotEmpty - Return the first non-null / non-undefined value found at any of the given paths.
    • deepCopy - Deep copy utility with class / DOM safeguards.
    • keys - Return the enumerable keys of a hash.
    • empty - Test whether a value is an empty hash (plain object with no keys).
    • slice - Slice selected keys/paths from a record into a new object.
  • lib.number
    • clamp - Clamp a value between optional bounds.
    • toInt - Parse/coerce a value into an integer using strict legacy-safe rules.
  • lib.require
    • all - Require targets on the main lib object.
    • lib - Alias of lib.require.all.
    • service - Require one or more registered services.
  • lib.service
    • set - Register a service by name.
    • get - Retrieve a service by name.
    • start - Start a named service when it exposes start().
    • stop - Stop a named service when it exposes stop().
    • list - List registered service names.
  • lib.str
    • is - Determine whether a value is a string primitive.
    • lc - Lowercase helper with optional forced coercion.
    • to - Coerce a value to a string (legacy-safe, normalized).
    • stripComments - Strip JavaScript-style comments from source text.
    • countChars - Counts the total occurrences of one or more characters in a string.
    • interp - Interpolate ${...} tokens with hash/eval resolution modes.
  • lib.utils
    • isArray - Alias passthrough to lib.array.is.
    • toArray - Alias passthrough to lib.array.to.
    • isHash - Alias passthrough to lib.hash.is.
    • toHash - Alias passthrough to lib.hash.to.
    • deepCopy - Alias passthrough to lib.hash.deepCopy.
    • isScalar - Determine whether a value is a scalar (leaf value).
    • toString - Alias passthrough to lib.str.to.
    • baseType - Determine the base type of a value, optionally comparing against allowed types.
    • isEmpty - Determine whether a value should be treated as "empty".
    • linkType - Classify a link-like value or test membership against allowed types.
    • clamp - Clamp a value to an allowed set.
    • toNumber - Coerce a value into a finite number.
    • getFunction - Alias passthrough to lib.func.get.
    • stripComments - Alias passthrough to lib.str.stripComments.
    • lc - Alias passthrough to lib.str.lc.
  • lib.dom
    • get - Get a value from a DOM element with a few legacy carve-outs.
    • set - Set a value on a DOM element using legacy-safe attribute/property rules.
    • is - Check whether a value is a DOM Element.
    • isDom - Check whether a value is a DOM Element.
    • getElement - Resolve an element reference.
    • byId - Alias for document.getElementById.
    • removeElement - Remove an element from the DOM.
    • qs - Parse the current query string into a plain object.
    • insertAfter - Insert a DOM node immediately after another node.
    • filterAttributes - Collect an element's attributes into a plain object, optionally filtering by regex.
    • attempt - Best-effort coercion from mixed input into a DOM node.
  • lib.dom.create
    • css - Create a stylesheet link element with default CSS attributes merged with caller attrs.
    • link - Alias of lib.dom.create.css.
    • js - Create a script element with default JS attributes merged with caller attrs.
    • element - Create a generic element and apply attributes/content.
  • lib.dom.append
    • before - Insert e before target.
    • after - Insert e after target.
    • prepend - Insert e as first child of target.
    • append - Insert e as last child of target.
    • beforeBegin - Insert e immediately before target using adjacent positioning.
    • afterBegin - Insert e as the first child inside target.
    • beforeEnd - Insert e as the last child inside target.
    • afterEnd - Insert e immediately after target using adjacent positioning.
    • adjacent - Insert using DOM-standard positions (mirrors insertAdjacentElement).
    • replace - Replace target with element.
    • remove - Remove target from DOM.
    • empty - Empty a target (remove all children).
    • resolveTarget - Resolve a target-ish input into a DOM Element.
  • lib.dom.form
    • submit - Submit from a trigger or collected payload through native or request-envelope flow.
    • collect - Alias of collectForm.
    • collectForm - Collect a form into { url, method, parms, form, event }.
    • toJson - Convert trigger/collected form into JSON-like object (inflated or flat).
    • makeUrl - Build final URL, appending query params for GET.
    • makeHeader - Build request headers from method/body/content type inputs.
    • makeBody - Build request body using JSON/urlencoded/form-data rules.
    • getDomKV - Read one element into {key,value} entry (or list of entries).
    • arrayToQS - Convert key/value tuple list into query string.
    • arrayToHash - Convert key/value tuple list into object with repeat keys as arrays.
  • lib.dom.transform
    • element - Bind a data scheme into one element subtree.
    • list - Clone a template for each row and apply transformElement.

Related