Skip to content

atmajs/utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0aefb7f · Dec 10, 2024
Jun 25, 2024
Jul 18, 2024
Jun 25, 2024
Jan 11, 2022
May 26, 2021
Apr 13, 2021
Feb 3, 2019
May 11, 2021
Apr 27, 2022
Jul 18, 2024
Dec 10, 2024
Jan 11, 2022
Jan 11, 2022
Jan 11, 2022
Feb 3, 2019

Repository files navigation

Util Functions

Build Status

Embeddable

  • lib/utils.embed.js All functions are in the top-level scope.

Module

  • All functions are wrapped to an object, e.g. require('atma-utils').obj_getProperty or import { obj_getProperty } from 'atma-utils'

Functions

  • Object

    • obj_getProperty(obj, path)
    • obj_setProperty(obj, path, val)
    • obj_extend(a, b)
    • obj_extendMany(a, [ ...args])
    • obj_create(obj)
  • Array

    • arr_remove
  • Function

    • fn_proxy(fn, ctx)
    • fn_doNothing
  • is

    • is_Function(x)
    • is_String(x)
    • is_notEmptyString(x)
    • is_Array(x)
    • is_ArrayLike(x)
    • is_Object(x)
    • is_rawObject(x)
  • class

    • class_create([...Base:Function|Object], Proto:Object)

      Proto := Object {
          constructor: Function,
          ...
      }
    • class_createEx

      Similar to class_create but also handles the property accessors. The class_create is in this way much more simple and has better performance.

    • class_Dfr

      Promise

    • class_EventEmitter

      Event Emitter

  • error

    • error_createClass(name:String, Proto:Object):Function
    • error_formatSource(source:String, index:Number, ?filename:String):String
    • error_cursor(source:String, index:Number):Array<lines, lineNum, rowNum>
    • error_formatCursor(lines:Array, lineNum: Number, rowNum: Number):String
  • Prototype fn references

    • _Array_slice
    • _Array_splice
    • _Array_indexOf
    • _Obj_hasOwnProp_

Build

$ npm install
$ npm run build

Release

  • Bump
  • Builds
  • Commit release branch
  • Push/Pulblish:
    • to git
    • to npm
$ npm install
$ npm run release

Test

$ npm install
$ npm test

©️ 2021 - MIT - Atma.js