Giter Club home page Giter Club logo

yaml-fl's Introduction

YAML Flexible Loader

โš ๏ธ This is a project that I haven't gotten around to actually implementing yet.

yaml-fl is a JavaScript module that converts YAML strings to JSON. It aims to make YAML parsing faster and more resilient to user input errors, which makes it suitable for situations where YAML is being edited and rendered in real time.

Internally, we sit on top of js-yaml's wonderful loader methods, but add additional work before the conversion phase. We do two broad things to achieve flexibility and speed:

  1. Attempt to correct typos and logical errors by piping the YAML string through a set of corrector rules.
  2. Recursively break down the string into smaller pieces (YAML sub-objects), convert them, cache the individual results, and reassemble the entire result into a JavaScript object.

Correctors

Correctors aim to avoid situations that cause parsing errors, and fix simple typos. They generally report warnings about any problems they come across.

  • 001-duplicated-keys: Reports and removes duplicated keys within the same mapping key, preserving the last definition.
  • 002-space-after-colon: Inserts missed spaces after colons for scalar values (i.e. a:1 -> a: 1).
  • 003-off-by-one-indent: Realigns badly indented lines by looking behind at the previous line.
  • 004-hash-in-unquoted-string: Escapes # characters in unquoted string values by wrapping the value in quotes.

yaml-fl's People

Contributors

shockey avatar

Stargazers

 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.