GithubHelp home page GithubHelp logo

marckol / serenix_indented_data Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 19 KB

Class utilities to parse indented text data. Useful to parse tree data or tree grid data from flat indented text data

License: MIT License

JavaScript 90.30% HTML 9.70%

serenix_indented_data's Introduction

serenix_indented_data

Contains class utilities to parse indented text data. Useful to parse tree data or tree grid data from flat indented text data.

DataType class

Contains following string conversion methods:

  • toInteger : returns a javascript integer if the string value corresponds to a int, long, byte, short, binary, unsigned int, unsigned short, unsigned byte unsigned long. Otherwise, throws an exception.
  • toInt
  • toShort
  • toByte
  • toLong
  • toNumber
  • toFloat
  • toDouble
  • toLongDouble
  • toUnsignedInt
  • toUnsignedShort
  • toUnsignedByte
  • toUnsignedLong
  • toUnsignedNumber
  • toUnsignedFloat
  • toUnsignedDouble

ITextData class

Contains following parse methods:

  • parse:

Parses the given indented string data.

When options argument is specified and it's a plain object and has one of the following 'nameField', 'itemsField', 'childrenField' or 'fields', each parsed node/item will have a "name" field and a "children" field.

When options fields property is defined and is an array, each parsed node/item will have fields with names in the array.

The final names of "name" field and a "children" field will be given by the value of nameField and childrenField of the options or fields when defined.

Parameters

: -

data

Type: String Description: The indented string data to parse. -

options

Type: Plain object or Number Description:

When the value of options argument is a number, it represents the number of spaces of a tabulation.

When the value of options argument is a plain object, it represents options (childrenField, nameField, ...) to use when parsing. The parsing method it's ITextData.kvParse (key-value parse).

Return type

Array
  • kvParse

serenix_indented_data's People

Contributors

marckol avatar

Watchers

 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.