npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

qverse

v0.1.21

Published

> Traverse any data with [DPML](https://github.com/janryWang/dot-match) commands. > > You can use qverse for [react-propers](https://github.com/janryWang/react-propers). > > Support pipeline operator.

Downloads

39

Readme

qverse

Traverse any data with DPML commands.

You can use qverse for react-propers.

Support pipeline operator.

Usage

import React from "react"
import ReactDOM from "react-dom"
import Propers from "react-propers"
import qverse,{produce} from "qverse"

ReactDOM.render(
   <Propers selector="$id" traverse={qverse(($)=>{
       $("*(aaa,bbb)").produce((props)=>{
           props.className = "yellow"
       })
       
       $("ddd").pipe(
         display(false)
       )
       
       $(["aaa","bbb"])
       |> produce(props=>{
           props.className += " blue-font"
       })
   })}>
      {React=>(
       <>
         <div $id="aaa">111</div>
         <div $id="bbb">222</div>
         <div $id="ccc">333</div>
         <div $id="ddd">444</div>
       </>
      )}
   </Propers>
)

//out put

<div class="yellow blue-font">111</div><div class="yellow blue-font">222</div><div>333</div>

Install

npm install --save qverse

API

qverse(ctrl : Controller ) : Traverse

create traverse with callback function

extend(proto : Object)

extend some methods for CommandFactory

produce(fn : Function)

pipline operator for produce data

display(show : Function | Boolean)

pipeline operator for show data

rescue()

pipeline operator for rescue data

select(DPML : String | Array<String> | Function , Options : MatchOptions)

pipeline operator for reselect data

filter(fn : Function)

pipeline operator for filter data

include(fn : Function)

pipeline operator for include data

exclude(fn : Function)

pipeline operator for exclude data

Interface

Controller

interface Controller {
  ($ : CommandFactory) : Traverse
}

CommandFactory

interface Replacer {
    $0:function(item : String) : String
    $1:function(item : String) : String
    $2:function(item : String) : String
    ....
}

interface CommandFactory {
   (DPML : String | Array<String> | Function , Options : MatchOptions) : Command
   replace(path : String,replacer : Replacer ) : String
   path() : Array<String>
   key() : String
   params() : any
   payload() : any
   state(path : String | Array) : any // State getter for CurrentParams
}

Command

interface Command {
    filter(params : CurrentParams) : Boolean
    exclude(params : CurrentParams) : Boolean
    include(params : CurrentParams) : Boolean
    produce(callback : function(payload : any): Boolean? ) : any //Here is the usage of https://github.com/mweststrate/immer
    rescue() : Void //Because our command is an orderly execution logic, if the previous command overrides the result of the following command, then we can use the rescue method.
    select(DPML : String | Array<String> | Function , Options : MatchOptions) : Command
    display(show : Function | Boolean) : Command
    call(fn : Function) : Command
}

MatchOptions


interface MachOptions {
    include?:function(params : CurrentParams) : Boolean;
    exclude?:function(params : CurrentParams) : Boolean
}

Traverse

interface Traverse{
   (payload : any,params : CurrentParams) : any
}

CurrentParams

interface CurrentParams {
    key:String,
    path:Array<String>
}

LICENSE

The MIT License (MIT)

Copyright (c) 2018 JanryWang

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.