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

ligle-util

v0.4.0

Published

ligle's utilities

Downloads

2

Readme

ligle-util

Build Status Build Status Copyright (c) 2015 A-Oak Co. Ltd.

安装

npm install ligle-util

https://www.npmjs.com/package/ligle-util

简介

ligle-engine使用的通用功能函数库

部分文档



var Person = Class.extend({
  init: function(isDancing){
    this.dancing = isDancing;
  },
  dance: function(){
    return this.dancing;
  }
});
 
var Ninja = Person.extend({
  init: function(){
    this._super( false );
  },
  dance: function(){
    // Call the inherited version of dance()
    return this._super();
  },
  swingSword: function(){
    return true;
  }
});
 
var p = new Person(true);
p.dance(); // => true
 
var n = new Ninja();
n.dance(); // => false
n.swingSword(); // => true
 
// Should all be true
p instanceof Person && p instanceof Class &&
n instanceof Ninja && n instanceof Person && n instanceof Class


  • name: 对config[name]项进行配置。(注意:config[name]必须是object,否则defaultCfg会覆盖它)。如果name是空字符串。那么会对整个config进行配置。

  • defaultCfg: 对config[name]项的内容进行赋值,如果config[name]中相应的项已经有了,那么就不使用默认值了。

  • 返回:配置好的config。

var config = {a:{xx:11,yy:22},b:{}};
var defaultCfg = {xx:12,zz:23};
// 对全局config中的a项进行配置
var cfg = configure(config,'a',defaultCfg);
// 结果:{ a: { xx: 11, yy: 22, zz: 23 }, b: {} }


config = {a:11,b:22};
defaultCfg = {a:1,b:2,c:3};
cfg = configure(config,'',defaultCfg);
// 结果:{ a: 11, b: 22, c: 3 }