Comparing version 6.0.0-beta.1 to 6.0.0-beta.2
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
122
cjs.js
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -8,3 +8,3 @@ * Released under the MIT License. | ||
function _append (arr, obj) { | ||
function append (arr, obj) { | ||
arr[arr.length] = obj; | ||
@@ -23,8 +23,8 @@ return arr; | ||
function _bindContext (iterator, context) { | ||
function bindContext (iterator, context) { | ||
return context ? iterator.bind(context) : iterator; | ||
} | ||
function _forSlice (value, start, end, iterator, context) { | ||
var cb = _bindContext(iterator, context); | ||
function forSlice (value, start, end, iterator, context) { | ||
var cb = bindContext(iterator, context); | ||
for (var i = start, returnValue = (void 0); returnValue !== false && i < end; i++) { | ||
@@ -35,6 +35,6 @@ returnValue = cb(value[i], i, value); | ||
function _forOwn (value, iterator, context) { | ||
iterator = _bindContext(iterator, context); | ||
function forOwn (value, iterator, context) { | ||
iterator = bindContext(iterator, context); | ||
var keys = Object.keys(value); | ||
_forSlice(Object.keys(value), 0, keys.length, function (key) { | ||
forSlice(Object.keys(value), 0, keys.length, function (key) { | ||
return iterator(value[key], key); | ||
@@ -49,5 +49,5 @@ }); | ||
var to = Object(target); | ||
_forSlice(arguments, 1, arguments.length, function (nextSource) { | ||
forSlice(arguments, 1, arguments.length, function (nextSource) { | ||
if (isObject(nextSource)) { | ||
_forOwn(nextSource, function (nextVal, nextKey) { | ||
forOwn(nextSource, function (nextVal, nextKey) { | ||
to[nextKey] = nextVal; | ||
@@ -60,8 +60,8 @@ }); | ||
function _forEach (value, iterator, context) { | ||
_forSlice(value, 0, value.length, iterator, context); | ||
function forEach (value, iterator, context) { | ||
forSlice(value, 0, value.length, iterator, context); | ||
} | ||
function _forIn (value, iterator, context) { | ||
var cb = _bindContext(iterator, context); | ||
var cb = bindContext(iterator, context); | ||
for (var key in value) { | ||
@@ -73,4 +73,4 @@ if (cb(value[key], key) === false) { | ||
function _forNumber (value, iterator, context) { | ||
var cb = _bindContext(iterator, context); | ||
function forNumber (value, iterator, context) { | ||
var cb = bindContext(iterator, context); | ||
for (var i = 0, returnValue = (void 0); returnValue !== false && i < value; i++) { | ||
@@ -91,9 +91,9 @@ returnValue = cb(i, i, i); | ||
function _map (method, elems, callback, context) { | ||
function map (method, elems, callback, context) { | ||
var ret = []; | ||
var cb = _bindContext(callback, context); | ||
var cb = bindContext(callback, context); | ||
method(elems, function (elem, key) { | ||
elem = cb(elem, key); | ||
if (!isNil(elem)) { | ||
_append(ret, elem); | ||
append(ret, elem); | ||
} | ||
@@ -116,7 +116,7 @@ }); | ||
if (isArrayLike(value)) { | ||
_forEach(value, cb, context); | ||
forEach(value, cb, context); | ||
} else if (isObject(value) || isFunction(value)) { | ||
_forOwn(value, cb, context); | ||
forOwn(value, cb, context); | ||
} else if (isNumber(value)) { | ||
_forNumber(value, cb, context); | ||
forNumber(value, cb, context); | ||
} | ||
@@ -128,3 +128,3 @@ } | ||
function getUID (obj) { | ||
function getUid (obj) { | ||
return obj[UID_PROPERTY] || | ||
@@ -213,4 +213,4 @@ (obj[UID_PROPERTY] = ++uidCounter); | ||
function map (elems, callback, context) { | ||
return _map(each, elems, callback, context); | ||
function map$1 (elems, callback, context) { | ||
return map(each, elems, callback, context); | ||
} | ||
@@ -238,40 +238,36 @@ | ||
var index = { | ||
_append: _append, | ||
_assign: _assign, | ||
_bindContext: _bindContext, | ||
_forEach: _forEach, | ||
_forIn: _forIn, | ||
_forNumber: _forNumber, | ||
_forOwn: _forOwn, | ||
_forSlice: _forSlice, | ||
_isInteger: _isInteger, | ||
_map: _map, | ||
assign: assign, | ||
each: each, | ||
getUID: getUID, | ||
hasOwn: hasOwn, | ||
isArrayLike: isArrayLike, | ||
isAsyncFunction: isAsyncFunction, | ||
isBoolean: isBoolean, | ||
isDate: isDate, | ||
isFunction: isFunction, | ||
isInteger: isInteger, | ||
isNil: isNil, | ||
isNumber: isNumber, | ||
isObject: isObject, | ||
isPlainObject: isPlainObject, | ||
isPromiseLike: isPromiseLike, | ||
isRegExp: isRegExp, | ||
isString: isString, | ||
isUndefined: isUndefined, | ||
isWindow: isWindow, | ||
looseEqual: looseEqual, | ||
map: map, | ||
noop: noop, | ||
sleep: sleep, | ||
toString: toString$1, | ||
type: type | ||
}; | ||
module.exports = index; | ||
exports._append = append; | ||
exports._assign = _assign; | ||
exports._bindContext = bindContext; | ||
exports._forEach = forEach; | ||
exports._forIn = _forIn; | ||
exports._forNumber = forNumber; | ||
exports._forOwn = forOwn; | ||
exports._forSlice = forSlice; | ||
exports._isInteger = _isInteger; | ||
exports._map = map; | ||
exports.assign = assign; | ||
exports.each = each; | ||
exports.getUid = getUid; | ||
exports.hasOwn = hasOwn; | ||
exports.isArrayLike = isArrayLike; | ||
exports.isAsyncFunction = isAsyncFunction; | ||
exports.isBoolean = isBoolean; | ||
exports.isDate = isDate; | ||
exports.isFunction = isFunction; | ||
exports.isInteger = isInteger; | ||
exports.isNil = isNil; | ||
exports.isNumber = isNumber; | ||
exports.isObject = isObject; | ||
exports.isPlainObject = isPlainObject; | ||
exports.isPromiseLike = isPromiseLike; | ||
exports.isRegExp = isRegExp; | ||
exports.isString = isString; | ||
exports.isUndefined = isUndefined; | ||
exports.isWindow = isWindow; | ||
exports.looseEqual = looseEqual; | ||
exports.map = map$1; | ||
exports.noop = noop; | ||
exports.sleep = sleep; | ||
exports.toString = toString$1; | ||
exports.type = type; |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
88
es.js
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
function _append (arr, obj) { | ||
function append (arr, obj) { | ||
arr[arr.length] = obj; | ||
@@ -20,8 +20,8 @@ return arr; | ||
function _bindContext (iterator, context) { | ||
function bindContext (iterator, context) { | ||
return context ? iterator.bind(context) : iterator; | ||
} | ||
function _forSlice (value, start, end, iterator, context) { | ||
var cb = _bindContext(iterator, context); | ||
function forSlice (value, start, end, iterator, context) { | ||
var cb = bindContext(iterator, context); | ||
for (var i = start, returnValue = (void 0); returnValue !== false && i < end; i++) { | ||
@@ -32,6 +32,6 @@ returnValue = cb(value[i], i, value); | ||
function _forOwn (value, iterator, context) { | ||
iterator = _bindContext(iterator, context); | ||
function forOwn (value, iterator, context) { | ||
iterator = bindContext(iterator, context); | ||
var keys = Object.keys(value); | ||
_forSlice(Object.keys(value), 0, keys.length, function (key) { | ||
forSlice(Object.keys(value), 0, keys.length, function (key) { | ||
return iterator(value[key], key); | ||
@@ -46,5 +46,5 @@ }); | ||
var to = Object(target); | ||
_forSlice(arguments, 1, arguments.length, function (nextSource) { | ||
forSlice(arguments, 1, arguments.length, function (nextSource) { | ||
if (isObject(nextSource)) { | ||
_forOwn(nextSource, function (nextVal, nextKey) { | ||
forOwn(nextSource, function (nextVal, nextKey) { | ||
to[nextKey] = nextVal; | ||
@@ -57,8 +57,8 @@ }); | ||
function _forEach (value, iterator, context) { | ||
_forSlice(value, 0, value.length, iterator, context); | ||
function forEach (value, iterator, context) { | ||
forSlice(value, 0, value.length, iterator, context); | ||
} | ||
function _forIn (value, iterator, context) { | ||
var cb = _bindContext(iterator, context); | ||
var cb = bindContext(iterator, context); | ||
for (var key in value) { | ||
@@ -70,4 +70,4 @@ if (cb(value[key], key) === false) { | ||
function _forNumber (value, iterator, context) { | ||
var cb = _bindContext(iterator, context); | ||
function forNumber (value, iterator, context) { | ||
var cb = bindContext(iterator, context); | ||
for (var i = 0, returnValue = (void 0); returnValue !== false && i < value; i++) { | ||
@@ -88,9 +88,9 @@ returnValue = cb(i, i, i); | ||
function _map (method, elems, callback, context) { | ||
function map (method, elems, callback, context) { | ||
var ret = []; | ||
var cb = _bindContext(callback, context); | ||
var cb = bindContext(callback, context); | ||
method(elems, function (elem, key) { | ||
elem = cb(elem, key); | ||
if (!isNil(elem)) { | ||
_append(ret, elem); | ||
append(ret, elem); | ||
} | ||
@@ -113,7 +113,7 @@ }); | ||
if (isArrayLike(value)) { | ||
_forEach(value, cb, context); | ||
forEach(value, cb, context); | ||
} else if (isObject(value) || isFunction(value)) { | ||
_forOwn(value, cb, context); | ||
forOwn(value, cb, context); | ||
} else if (isNumber(value)) { | ||
_forNumber(value, cb, context); | ||
forNumber(value, cb, context); | ||
} | ||
@@ -125,3 +125,3 @@ } | ||
function getUID (obj) { | ||
function getUid (obj) { | ||
return obj[UID_PROPERTY] || | ||
@@ -210,4 +210,4 @@ (obj[UID_PROPERTY] = ++uidCounter); | ||
function map (elems, callback, context) { | ||
return _map(each, elems, callback, context); | ||
function map$1 (elems, callback, context) { | ||
return map(each, elems, callback, context); | ||
} | ||
@@ -235,40 +235,2 @@ | ||
var index = { | ||
_append: _append, | ||
_assign: _assign, | ||
_bindContext: _bindContext, | ||
_forEach: _forEach, | ||
_forIn: _forIn, | ||
_forNumber: _forNumber, | ||
_forOwn: _forOwn, | ||
_forSlice: _forSlice, | ||
_isInteger: _isInteger, | ||
_map: _map, | ||
assign: assign, | ||
each: each, | ||
getUID: getUID, | ||
hasOwn: hasOwn, | ||
isArrayLike: isArrayLike, | ||
isAsyncFunction: isAsyncFunction, | ||
isBoolean: isBoolean, | ||
isDate: isDate, | ||
isFunction: isFunction, | ||
isInteger: isInteger, | ||
isNil: isNil, | ||
isNumber: isNumber, | ||
isObject: isObject, | ||
isPlainObject: isPlainObject, | ||
isPromiseLike: isPromiseLike, | ||
isRegExp: isRegExp, | ||
isString: isString, | ||
isUndefined: isUndefined, | ||
isWindow: isWindow, | ||
looseEqual: looseEqual, | ||
map: map, | ||
noop: noop, | ||
sleep: sleep, | ||
toString: toString$1, | ||
type: type | ||
}; | ||
export default index; | ||
export { append as _append, _assign, bindContext as _bindContext, forEach as _forEach, _forIn, forNumber as _forNumber, forOwn as _forOwn, forSlice as _forSlice, _isInteger, map as _map, assign, each, getUid, hasOwn, isArrayLike, isAsyncFunction, isBoolean, isDate, isFunction, isInteger, isNil, isNumber, isObject, isPlainObject, isPromiseLike, isRegExp, isString, isUndefined, isWindow, looseEqual, map$1 as map, noop, sleep, toString$1 as toString, type }; |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
{ | ||
"name": "celia", | ||
"version": "6.0.0-beta.1", | ||
"version": "6.0.0-beta.2", | ||
"description": "A modern JavaScript utility library delivering modularity, performance, and extras.", | ||
"main": "./cjs.js", | ||
"main": "./index.js", | ||
"module": "./es.js", | ||
@@ -50,3 +50,3 @@ "unpkg": "./umd.js", | ||
"rollup-plugin-buble": "^0.19.6", | ||
"rollup-plugin-combine": "^1.0.0-beta.1", | ||
"rollup-plugin-combine": "^1.0.0", | ||
"rollup-plugin-commonjs": "^9.2.0", | ||
@@ -53,0 +53,0 @@ "rollup-plugin-flow-no-whitespace": "^1.0.0", |
143
README.md
@@ -16,3 +16,2 @@ # celia | ||
- [Manipulation](#Manipulation) | ||
- [API](#API) | ||
- [Release History](#Release-History) | ||
@@ -27,3 +26,3 @@ | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/celia@6.0.0-beta.1/umd.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/celia@6.0.0-beta.2/iife.min.js"></script> | ||
``` | ||
@@ -40,17 +39,111 @@ | ||
// es6 | ||
import celia from 'celia'; | ||
// or | ||
import celia from 'celia/es'; | ||
import { | ||
assign, | ||
each, | ||
getUID, | ||
hasOwn, | ||
isArrayLike, | ||
isAsyncFunction, | ||
isBoolean, | ||
isDate, | ||
isFunction, | ||
isInteger, | ||
isNil, | ||
isNumber, | ||
isObject, | ||
isPlainObject, | ||
isPromiseLike, | ||
isRegExp, | ||
isString, | ||
isUndefined, | ||
isWindow, | ||
looseEqual, | ||
map, | ||
noop, | ||
sleep, | ||
toString, | ||
type | ||
} from 'celia'); | ||
// modularity | ||
import each from 'celia/each'; | ||
import isDate from 'celia/isDate'; | ||
import assign from 'celia/es/assign'; | ||
import each from 'celia/es/each'; | ||
import getUID from 'celia/es/getUID'; | ||
import hasOwn from 'celia/es/hasOwn'; | ||
import isArrayLike from 'celia/es/isArrayLike'; | ||
import isAsyncFunction from 'celia/es/isAsyncFunction'; | ||
import isBoolean from 'celia/es/isBoolean'; | ||
import isDate from 'celia/es/isDate'; | ||
import isFunction from 'celia/es/isFunction'; | ||
import isInteger from 'celia/es/isInteger'; | ||
import isNil from 'celia/es/isNil'; | ||
import isNumber from 'celia/es/isNumber'; | ||
import isObject from 'celia/es/isObject'; | ||
import isPlainObject from 'celia/es/isPlainObject'; | ||
import isPromiseLike from 'celia/es/isPromiseLike'; | ||
import isRegExp from 'celia/es/isRegExp'; | ||
import isString from 'celia/es/isString'; | ||
import isUndefined from 'celia/es/isUndefined'; | ||
import isWindow from 'celia/es/isWindow'; | ||
import looseEqual from 'celia/es/looseEqual'; | ||
import map from 'celia/es/map'; | ||
import noop from 'celia/es/noop'; | ||
import sleep from 'celia/es/sleep'; | ||
import toString from 'celia/es/toString'; | ||
import type from 'celia/es/type'; | ||
// node | ||
const celia = require('celia'); | ||
const { each } = celia; | ||
const { isDate } = celia; | ||
const { | ||
assign, | ||
each, | ||
getUID, | ||
hasOwn, | ||
isArrayLike, | ||
isAsyncFunction, | ||
isBoolean, | ||
isDate, | ||
isFunction, | ||
isInteger, | ||
isNil, | ||
isNumber, | ||
isObject, | ||
isPlainObject, | ||
isPromiseLike, | ||
isRegExp, | ||
isString, | ||
isUndefined, | ||
isWindow, | ||
looseEqual, | ||
map, | ||
noop, | ||
sleep, | ||
toString, | ||
type | ||
} = require('celia'); | ||
// or | ||
const assign = require('celia/assign'); | ||
const each = require('celia/each'); | ||
const getUID = require('celia/getUID'); | ||
const hasOwn = require('celia/hasOwn'); | ||
const isArrayLike = require('celia/isArrayLike'); | ||
const isAsyncFunction = require('celia/isAsyncFunction'); | ||
const isBoolean = require('celia/isBoolean'); | ||
const isDate = require('celia/isDate'); | ||
const isFunction = require('celia/isFunction'); | ||
const isInteger = require('celia/isInteger'); | ||
const isNil = require('celia/isNil'); | ||
const isNumber = require('celia/isNumber'); | ||
const isObject = require('celia/isObject'); | ||
const isPlainObject = require('celia/isPlainObject'); | ||
const isPromiseLike = require('celia/isPromiseLike'); | ||
const isRegExp = require('celia/isRegExp'); | ||
const isString = require('celia/isString'); | ||
const isUndefined = require('celia/isUndefined'); | ||
const isWindow = require('celia/isWindow'); | ||
const looseEqual = require('celia/looseEqual'); | ||
const map = require('celia/map'); | ||
const noop = require('celia/noop'); | ||
const sleep = require('celia/sleep'); | ||
const toString = require('celia/toString'); | ||
const type = require('celia/type'); | ||
@@ -63,33 +156,3 @@ | ||
### Manipulation | ||
### API | ||
- assign | ||
- each | ||
- getUID | ||
- hasOwn | ||
- isArrayLike | ||
- isAsyncFunction | ||
- isBoolean | ||
- isDate | ||
- isFunction | ||
- isInteger | ||
- isNil | ||
- isNumber | ||
- isObject | ||
- isPlainObject | ||
- isPromiseLike | ||
- isRegExp | ||
- isString | ||
- isUndefined | ||
- isWindow | ||
- looseEqual | ||
- map | ||
- noop | ||
- sleep | ||
- toString | ||
- type | ||
## Release History |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
130
umd.js
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -7,8 +7,8 @@ * Released under the MIT License. | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global = global || self, (global.umd = global.umd || {}, global.umd.js = factory())); | ||
}(this, function () { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = global || self, factory(global.celia = {})); | ||
}(this, function (exports) { 'use strict'; | ||
function _append (arr, obj) { | ||
function append (arr, obj) { | ||
arr[arr.length] = obj; | ||
@@ -27,8 +27,8 @@ return arr; | ||
function _bindContext (iterator, context) { | ||
function bindContext (iterator, context) { | ||
return context ? iterator.bind(context) : iterator; | ||
} | ||
function _forSlice (value, start, end, iterator, context) { | ||
var cb = _bindContext(iterator, context); | ||
function forSlice (value, start, end, iterator, context) { | ||
var cb = bindContext(iterator, context); | ||
for (var i = start, returnValue = (void 0); returnValue !== false && i < end; i++) { | ||
@@ -39,6 +39,6 @@ returnValue = cb(value[i], i, value); | ||
function _forOwn (value, iterator, context) { | ||
iterator = _bindContext(iterator, context); | ||
function forOwn (value, iterator, context) { | ||
iterator = bindContext(iterator, context); | ||
var keys = Object.keys(value); | ||
_forSlice(Object.keys(value), 0, keys.length, function (key) { | ||
forSlice(Object.keys(value), 0, keys.length, function (key) { | ||
return iterator(value[key], key); | ||
@@ -53,5 +53,5 @@ }); | ||
var to = Object(target); | ||
_forSlice(arguments, 1, arguments.length, function (nextSource) { | ||
forSlice(arguments, 1, arguments.length, function (nextSource) { | ||
if (isObject(nextSource)) { | ||
_forOwn(nextSource, function (nextVal, nextKey) { | ||
forOwn(nextSource, function (nextVal, nextKey) { | ||
to[nextKey] = nextVal; | ||
@@ -64,8 +64,8 @@ }); | ||
function _forEach (value, iterator, context) { | ||
_forSlice(value, 0, value.length, iterator, context); | ||
function forEach (value, iterator, context) { | ||
forSlice(value, 0, value.length, iterator, context); | ||
} | ||
function _forIn (value, iterator, context) { | ||
var cb = _bindContext(iterator, context); | ||
var cb = bindContext(iterator, context); | ||
for (var key in value) { | ||
@@ -77,4 +77,4 @@ if (cb(value[key], key) === false) { | ||
function _forNumber (value, iterator, context) { | ||
var cb = _bindContext(iterator, context); | ||
function forNumber (value, iterator, context) { | ||
var cb = bindContext(iterator, context); | ||
for (var i = 0, returnValue = (void 0); returnValue !== false && i < value; i++) { | ||
@@ -95,9 +95,9 @@ returnValue = cb(i, i, i); | ||
function _map (method, elems, callback, context) { | ||
function map (method, elems, callback, context) { | ||
var ret = []; | ||
var cb = _bindContext(callback, context); | ||
var cb = bindContext(callback, context); | ||
method(elems, function (elem, key) { | ||
elem = cb(elem, key); | ||
if (!isNil(elem)) { | ||
_append(ret, elem); | ||
append(ret, elem); | ||
} | ||
@@ -120,7 +120,7 @@ }); | ||
if (isArrayLike(value)) { | ||
_forEach(value, cb, context); | ||
forEach(value, cb, context); | ||
} else if (isObject(value) || isFunction(value)) { | ||
_forOwn(value, cb, context); | ||
forOwn(value, cb, context); | ||
} else if (isNumber(value)) { | ||
_forNumber(value, cb, context); | ||
forNumber(value, cb, context); | ||
} | ||
@@ -132,3 +132,3 @@ } | ||
function getUID (obj) { | ||
function getUid (obj) { | ||
return obj[UID_PROPERTY] || | ||
@@ -217,4 +217,4 @@ (obj[UID_PROPERTY] = ++uidCounter); | ||
function map (elems, callback, context) { | ||
return _map(each, elems, callback, context); | ||
function map$1 (elems, callback, context) { | ||
return map(each, elems, callback, context); | ||
} | ||
@@ -242,42 +242,38 @@ | ||
var index = { | ||
_append: _append, | ||
_assign: _assign, | ||
_bindContext: _bindContext, | ||
_forEach: _forEach, | ||
_forIn: _forIn, | ||
_forNumber: _forNumber, | ||
_forOwn: _forOwn, | ||
_forSlice: _forSlice, | ||
_isInteger: _isInteger, | ||
_map: _map, | ||
assign: assign, | ||
each: each, | ||
getUID: getUID, | ||
hasOwn: hasOwn, | ||
isArrayLike: isArrayLike, | ||
isAsyncFunction: isAsyncFunction, | ||
isBoolean: isBoolean, | ||
isDate: isDate, | ||
isFunction: isFunction, | ||
isInteger: isInteger, | ||
isNil: isNil, | ||
isNumber: isNumber, | ||
isObject: isObject, | ||
isPlainObject: isPlainObject, | ||
isPromiseLike: isPromiseLike, | ||
isRegExp: isRegExp, | ||
isString: isString, | ||
isUndefined: isUndefined, | ||
isWindow: isWindow, | ||
looseEqual: looseEqual, | ||
map: map, | ||
noop: noop, | ||
sleep: sleep, | ||
toString: toString$1, | ||
type: type | ||
}; | ||
exports._append = append; | ||
exports._assign = _assign; | ||
exports._bindContext = bindContext; | ||
exports._forEach = forEach; | ||
exports._forIn = _forIn; | ||
exports._forNumber = forNumber; | ||
exports._forOwn = forOwn; | ||
exports._forSlice = forSlice; | ||
exports._isInteger = _isInteger; | ||
exports._map = map; | ||
exports.assign = assign; | ||
exports.each = each; | ||
exports.getUid = getUid; | ||
exports.hasOwn = hasOwn; | ||
exports.isArrayLike = isArrayLike; | ||
exports.isAsyncFunction = isAsyncFunction; | ||
exports.isBoolean = isBoolean; | ||
exports.isDate = isDate; | ||
exports.isFunction = isFunction; | ||
exports.isInteger = isInteger; | ||
exports.isNil = isNil; | ||
exports.isNumber = isNumber; | ||
exports.isObject = isObject; | ||
exports.isPlainObject = isPlainObject; | ||
exports.isPromiseLike = isPromiseLike; | ||
exports.isRegExp = isRegExp; | ||
exports.isString = isString; | ||
exports.isUndefined = isUndefined; | ||
exports.isWindow = isWindow; | ||
exports.looseEqual = looseEqual; | ||
exports.map = map$1; | ||
exports.noop = noop; | ||
exports.sleep = sleep; | ||
exports.toString = toString$1; | ||
exports.type = type; | ||
return index; | ||
})); |
/* | ||
* celia.js v6.0.0-beta.1 | ||
* celia.js v6.0.0-beta.2 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
var n,t;n=this,t=function(){"use strict";function u(n,t){return n[n.length]=t,n}function c(n){return null==n}function i(n){return null!==n&&"object"==typeof n}function f(n,t){return t?n.bind(t):n}function o(n,t,e,r,o){for(var i=f(r,o),u=t,c=void 0;!1!==c&&u<e;u++)c=i(n[u],u,n)}function r(t,e,n){e=f(e,n);var r=Object.keys(t);o(Object.keys(t),0,r.length,function(n){return e(t[n],n)})}function n(n){if(c(n))throw new TypeError("Cannot convert undefined or null to object");var e=Object(n);return o(arguments,1,arguments.length,function(n){i(n)&&r(n,function(n,t){e[t]=n})}),e}function a(n,t,e){o(n,0,n.length,t,e)}function s(n,t,e){for(var r=f(t,e),o=0,i=void 0;!1!==i&&o<n;o++)i=r(o,o,o)}function l(n){return"number"==typeof n}function t(n){return l(n)&&isFinite(n)&&n>>0===n}function b(n,t,e,r){var o=[],i=f(e,r);return n(t,function(n,t){c(n=i(n,t))||u(o,n)}),o}var e=Object.assign||n;function p(n){return"function"==typeof n}function y(n){return!c(n)&&l(n.length)&&!p(n)}function g(n,t,e){y(n)?a(n,t,e):i(n)||p(n)?r(n,t,e):l(n)&&s(n,t,e)}var d="celia_uid_"+(1e9*Math.random()>>>0),v=0;var j=Object.prototype.hasOwnProperty;var h=Object.prototype.toString;function m(n){return h.call(n)}function O(n){return n instanceof Date}var _=Number.isInteger||t;function w(n){return n instanceof RegExp}var E=Array.isArray;var S={};return"Boolean,Number,String,Function,AsyncFunction,Array,Date,RegExp,Object,Error,Symbol".split(",").forEach(function(n){S["[object "+n+"]"]=n.toLowerCase()}),{_append:u,_assign:n,_bindContext:f,_forEach:a,_forIn:function(n,t,e){var r=f(t,e);for(var o in n)if(!1===r(n[o],o))break},_forNumber:s,_forOwn:r,_forSlice:o,_isInteger:t,_map:b,assign:e,each:g,getUID:function(n){return n[d]||(n[d]=++v)},hasOwn:function(n,t){return j.call(n,t)},isArrayLike:y,isAsyncFunction:function(n){return"[object AsyncFunction]"===m(n)},isBoolean:function(n){return"boolean"==typeof n},isDate:O,isFunction:p,isInteger:_,isNil:c,isNumber:l,isObject:i,isPlainObject:function(n){return!c(n)&&"[object Object]"===m(n)},isPromiseLike:function(n){return!!n&&p(n.then)&&p(n.catch)},isRegExp:w,isString:function(n){return"string"==typeof n},isUndefined:function(n){return void 0===n},isWindow:function(n){return n&&n===n.window},looseEqual:function e(t,r){if(i(t)&&i(r)){if(E(t)&&E(r))return t.length===r.length&&t.every(function(n,t){return e(n,r[t])});if(O(t)&&O(r))return+t==+r;if(w(t)&&w(r))return t.toString()===r.toString();var n=Object.keys(t),o=Object.keys(r);return n.length===o.length&&n.every(function(n){return e(t[n],r[n])})}return t===r},map:function(n,t,e){return b(g,n,t,e)},noop:function(){},sleep:function(t){return new Promise(function(n){setTimeout(n,t)})},toString:m,type:function(n){return c(n)?n+"":i(n)||p(n)?S[m(n)]||"object":typeof n}}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((n=n||self).umd=n.umd||{},n.umd.js=t()); | ||
var n,t;n=this,t=function(n){"use strict";function u(n,t){return n[n.length]=t,n}function c(n){return null==n}function i(n){return null!==n&&"object"==typeof n}function f(n,t){return t?n.bind(t):n}function o(n,t,e,r,o){for(var i=f(r,o),u=t,c=void 0;!1!==c&&u<e;u++)c=i(n[u],u,n)}function r(t,e,n){e=f(e,n);var r=Object.keys(t);o(Object.keys(t),0,r.length,function(n){return e(t[n],n)})}function t(n){if(c(n))throw new TypeError("Cannot convert undefined or null to object");var e=Object(n);return o(arguments,1,arguments.length,function(n){i(n)&&r(n,function(n,t){e[t]=n})}),e}function a(n,t,e){o(n,0,n.length,t,e)}function s(n,t,e){for(var r=f(t,e),o=0,i=void 0;!1!==i&&o<n;o++)i=r(o,o,o)}function l(n){return"number"==typeof n}function e(n){return l(n)&&isFinite(n)&&n>>0===n}function b(n,t,e,r){var o=[],i=f(e,r);return n(t,function(n,t){c(n=i(n,t))||u(o,n)}),o}var p=Object.assign||t;function y(n){return"function"==typeof n}function g(n){return!c(n)&&l(n.length)&&!y(n)}function d(n,t,e){g(n)?a(n,t,e):i(n)||y(n)?r(n,t,e):l(n)&&s(n,t,e)}var v="celia_uid_"+(1e9*Math.random()>>>0),h=0;var j=Object.prototype.hasOwnProperty;var O=Object.prototype.toString;function m(n){return O.call(n)}function _(n){return n instanceof Date}var w=Number.isInteger||e;function E(n){return n instanceof RegExp}var S=Array.isArray;var k={};"Boolean,Number,String,Function,AsyncFunction,Array,Date,RegExp,Object,Error,Symbol".split(",").forEach(function(n){k["[object "+n+"]"]=n.toLowerCase()}),n._append=u,n._assign=t,n._bindContext=f,n._forEach=a,n._forIn=function(n,t,e){var r=f(t,e);for(var o in n)if(!1===r(n[o],o))break},n._forNumber=s,n._forOwn=r,n._forSlice=o,n._isInteger=e,n._map=b,n.assign=p,n.each=d,n.getUid=function(n){return n[v]||(n[v]=++h)},n.hasOwn=function(n,t){return j.call(n,t)},n.isArrayLike=g,n.isAsyncFunction=function(n){return"[object AsyncFunction]"===m(n)},n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=_,n.isFunction=y,n.isInteger=w,n.isNil=c,n.isNumber=l,n.isObject=i,n.isPlainObject=function(n){return!c(n)&&"[object Object]"===m(n)},n.isPromiseLike=function(n){return!!n&&y(n.then)&&y(n.catch)},n.isRegExp=E,n.isString=function(n){return"string"==typeof n},n.isUndefined=function(n){return void 0===n},n.isWindow=function(n){return n&&n===n.window},n.looseEqual=function e(t,r){if(i(t)&&i(r)){if(S(t)&&S(r))return t.length===r.length&&t.every(function(n,t){return e(n,r[t])});if(_(t)&&_(r))return+t==+r;if(E(t)&&E(r))return t.toString()===r.toString();var n=Object.keys(t),o=Object.keys(r);return n.length===o.length&&n.every(function(n){return e(t[n],r[n])})}return t===r},n.map=function(n,t,e){return b(d,n,t,e)},n.noop=function(){},n.sleep=function(t){return new Promise(function(n){setTimeout(n,t)})},n.toString=m,n.type=function(n){return c(n)?n+"":i(n)||y(n)?k[m(n)]||"object":typeof n}},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).celia={}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
69254
82
1877
155
0