New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

zero-lang

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zero-lang - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

Makefile

2

lib/type.js

@@ -30,2 +30,4 @@ 'use strict';

checkType.isNil = (obj) => checkType.isNull(obj) || checkType.isUndefined(obj);
module.exports = checkType;

2

package.json

@@ -6,3 +6,3 @@ {

"homepage": "https://github.com/leungwensen/zero-lang",
"version": "0.1.0",
"version": "0.1.1",
"main": "lib/index.js",

@@ -9,0 +9,0 @@ "author": "leungwensen",

zero-lang
====================
language utils (like underscore)
## install

@@ -5,0 +7,0 @@

const zeroLang = require('../lib');
const expect = chai.expect;
describe('zero-array', () => {
describe('zero-lang/array', () => {
const indexOf = zeroLang.index(true);

@@ -6,0 +6,0 @@ const lastIndexOf = zeroLang.index(false);

@@ -5,3 +5,3 @@ /* globals hello */

describe('zero-lang-global', () => {
describe('zero-lang/global', () => {
it('exists', () => {

@@ -8,0 +8,0 @@ expect(typeof zeroLang.global).to.equal('object');

const zeroLang = require('../lib');
const expect = chai.expect;
describe('zero-number', () => {
it('zero-number.isDecimal', () => {
describe('zero-lang/number', () => {
it('zeroLang.isDecimal', () => {
expect(zeroLang.isDecimal(1)).to.equal(false);

@@ -10,3 +10,3 @@ expect(zeroLang.isDecimal(1.1)).to.equal(true);

});
it('zero-number.isEven', () => { // 偶数
it('zeroLang.isEven', () => { // 偶数
expect(zeroLang.isEven(1)).to.equal(false);

@@ -17,3 +17,3 @@ expect(zeroLang.isEven(20)).to.equal(true);

});
it('zero-number.isOdd', () => { // 奇数
it('zeroLang.isOdd', () => { // 奇数
expect(zeroLang.isOdd(1)).to.equal(true);

@@ -24,3 +24,3 @@ expect(zeroLang.isOdd(20)).to.equal(false);

});
it('zero-number.isInteger', () => {
it('zeroLang.isInteger', () => {
expect(zeroLang.isInteger(1)).to.equal(true);

@@ -31,3 +31,3 @@ expect(zeroLang.isInteger(20.1)).to.equal(false);

});
it('zero-number.isNegative', () => {
it('zeroLang.isNegative', () => {
expect(zeroLang.isNegative(1)).to.equal(false);

@@ -38,3 +38,3 @@ expect(zeroLang.isNegative(-20.1)).to.equal(true);

});
it('zero-number.isPositive', () => {
it('zeroLang.isPositive', () => {
expect(zeroLang.isPositive(1)).to.equal(true);

@@ -45,3 +45,3 @@ expect(zeroLang.isPositive(-20.1)).to.equal(false);

});
it('zero-number.isNumber', () => {
it('zeroLang.isNumber', () => {
expect(zeroLang.isNumber(NaN)).to.equal(true);

@@ -51,3 +51,3 @@ expect(zeroLang.isNumber(1)).to.equal(true);

});
it('zero-number.isInRange', () => {
it('zeroLang.isInRange', () => {
const falsey = [undefined, '', 0, false, NaN, null, undefined];

@@ -54,0 +54,0 @@ expect(zeroLang.isInRange(3, 5)).to.equal(true);

const zeroLang = require('../lib');
const expect = chai.expect;
describe('zero-object', () => {
describe('zero-lang/object', () => {
const obj = {

@@ -9,3 +9,3 @@ foo: 'bar',

};
it('delete in zero-object.forIn()', () => {
it('delete in zeroLang.forIn()', () => {
zeroLang.forIn(obj, (value, key) => {

@@ -52,3 +52,3 @@ if (value === 'bar') {

zeroLang.merge(destObj1, obj1, obj2, obj3);
it('object.merge(dest)', () => { // 深度合并
it('zeroLang.merge(dest)', () => { // 深度合并
// expect(destObj1.hello).to.equal('world');

@@ -64,3 +64,3 @@ expect(destObj1.foo).to.equal('too');

zeroLang.extend(destObj2, obj1, obj2, obj3);
it('object.extend(dest)', () => { // 扩展
it('zeroLang.extend(dest)', () => { // 扩展
expect(destObj1.hello).to.deep.equal(['world', 'html', 'object']);

@@ -74,3 +74,3 @@ expect(destObj2.foo).to.equal('too');

it('object.clone(dest)', () => {
it('zeroLang.clone(dest)', () => {
expect(zeroLang.clone(obj2).bar).not.to.equal(obj2.bar);

@@ -80,3 +80,3 @@ expect(zeroLang.clone(obj2).bar).to.deep.equal(obj2.bar);

it('object.invert(obj)', () => {
it('zeroLang.invert(obj)', () => {
expect(zeroLang.invert(obj2.bar.wee)).to.deep.equal({

@@ -83,0 +83,0 @@ gee: 'hoo',

const zeroLang = require('../lib');
const expect = chai.expect;
describe('zero-string', () => {
it('zero-string.isString', () => {
describe('zero-lang/string', () => {
it('zeroLang.isString', () => {
expect(zeroLang.isString('')).to.equal(true);
});
it('zero-string.trim', () => {
it('zeroLang.trim', () => {
expect(zeroLang.trim(' ')).to.equal('');

@@ -14,3 +14,3 @@ expect(zeroLang.trim(' a')).to.equal('a');

});
it('zero-string.trimLeft', () => {
it('zeroLang.trimLeft', () => {
expect(zeroLang.trimLeft(' a')).to.equal('a');

@@ -20,3 +20,3 @@ expect(zeroLang.trimLeft('b ')).to.equal('b ');

});
it('zero-string.trimRight', () => {
it('zeroLang.trimRight', () => {
expect(zeroLang.trimRight(' a')).to.equal(' a');

@@ -26,3 +26,3 @@ expect(zeroLang.trimRight('b ')).to.equal('b');

});
it('zero-string.hasSubString', () => {
it('zeroLang.hasSubString', () => {
expect(zeroLang.hasSubString(' a', 'a')).to.equal(true);

@@ -29,0 +29,0 @@ expect(zeroLang.hasSubString('b ', 'a')).to.equal(false);

@@ -7,12 +7,12 @@ const zeroLang = require('../lib');

describe('zero-lang.is$Type(obj)', () => {
it('zero-lang.isArguments', () => {
describe('zero-lang/type', () => {
it('zeroLang.isArguments', () => {
expect(zeroLang.isArguments([])).to.equal(false);
expect(zeroLang.isArguments(arguments)).to.equal(true);
});
it('zero-lang.isArray', () => {
it('zeroLang.isArray', () => {
expect(zeroLang.isArray([])).to.equal(true);
expect(zeroLang.isArray(1)).to.equal(false);
});
it('zero-lang.isBoolean', () => {
it('zeroLang.isBoolean', () => {
expect(zeroLang.isBoolean(true)).to.equal(true);

@@ -22,7 +22,7 @@ expect(zeroLang.isBoolean(false)).to.equal(true);

});
it('zero-lang.isFunction', () => {
it('zeroLang.isFunction', () => {
expect(zeroLang.isFunction(noop)).to.equal(true);
expect(zeroLang.isFunction(1)).to.equal(false);
});
it('zero-lang.isNumber', () => {
it('zeroLang.isNumber', () => {
expect(zeroLang.isNumber(NaN)).to.equal(true);

@@ -32,3 +32,3 @@ expect(zeroLang.isNumber(1)).to.equal(true);

});
it('zero-lang.isObject', () => {
it('zeroLang.isObject', () => {
expect(zeroLang.isObject({})).to.equal(true);

@@ -39,3 +39,3 @@ expect(zeroLang.isObject(null)).to.equal(false);

});
it('zero-lang.isPlainObject', () => {
it('zeroLang.isPlainObject', () => {
expect(zeroLang.isPlainObject({})).to.equal(true);

@@ -46,14 +46,20 @@ expect(zeroLang.isPlainObject(null)).to.equal(false);

});
it('zero-lang.isString', () => {
it('zeroLang.isString', () => {
expect(zeroLang.isString('')).to.equal(true);
});
it('zero-lang.isError', () => {
it('zeroLang.isError', () => {
expect(zeroLang.isError(new Error())).to.equal(true);
});
it('zero-lang.isDate', () => {
it('zeroLang.isDate', () => {
expect(zeroLang.isDate(new Date())).to.equal(true);
});
it('zero-lang.isRegExp', () => {
it('zeroLang.isRegExp', () => {
expect(zeroLang.isRegExp(/^..$/)).to.equal(true);
});
it('zeroLang.isNil', () => {
expect(zeroLang.isNil({})).to.equal(false);
expect(zeroLang.isNil(null)).to.equal(true);
expect(zeroLang.isNil()).to.equal(true);
expect(zeroLang.isNil(noop)).to.equal(false);
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc