Git Product home page Git Product logo

skeleutils's Introduction

  ___________          .__                 __  .__.__
 /   _____/  | __ ____ |  |   ____  __ ___/  |_|__|  |   ______
 \_____  \|  |/ // __ \|  | _/ __ \|  |  \   __\  |  |  /  ___/
 /        \    <\  ___/|  |_\  ___/|  |  /|  | |  |  |__\___ \
/_______  /__|_ \\___  >____/\___  >____/ |__| |__|____/____  >
        \/     \/    \/          \/                         \/

INTRO

Skeleutils package is part of the Skeletor project and is not meant be used alone.

Inside a Skeletor app this package provides common utilities, prototypes and general helpers.

Logger

SkeleUtils.GlobalUtilities.logger (message, type, force, stackTrace, customSeparator): can be used to send console logs, that will be displayed based on the value of the app's debug variable; parameters:

  • message: [any] (mandatory) something to print in the console's log; if it's a string can contain <separator> pattern, that will be replaced with a line separator;
  • type: [string] (optional) a string defining the style of the log; it can be extended by adding custom css rules to the SkeleUtils.GlobalVariables.logTypes object;
  • force: [boolean] (optional) force the log to be displayed also if app's debug variable is false (default to true);
  • stackTrace: [boolean] (optional) display the stack trace together with the log (default to false);
  • customSeparator: [string] (optional) the separator to be used to replace <separator> string in the message; can be a property of the SkeleUtils.GlobalVariables.logSeparators object or directly the string to use (default to SkeleUtils.GlobalVariables.logSeparators.default);

Strings

The package extends javascript's String with the following methods:

  • ltrim: left trim;
  • rtrim: right trim;
  • replaceAll(search, replace): replaces all occurrencies in the string;
    • search: [string] (optional) sub-string to search;
    • replace: [string] (optional) string to replace to any match;
  • dasherize: replaces whitespaces with "-";
  • capitalize: capitalize the string;
  • splitAt(index): splits the string at a given index (returns an array);
    • index: [string] (optional) the index to split at (default to string's length);

skeleutils's People

Contributors

cerealkillerway avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.