@daybrush/utils
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -16,2 +16,3 @@ export interface ObjectInterface<T> { | ||
export declare const UNDEFINED = "undefined"; | ||
export declare const IS_WINDOW: boolean; | ||
export declare const getCrossBrowserProperty: (property: string) => string; | ||
@@ -18,0 +19,0 @@ export declare const TRANSFORM: string; |
@@ -6,3 +6,3 @@ /* | ||
repository: https://github.com/daybrush/utils | ||
@version 0.3.0 | ||
@version 0.4.0 | ||
*/ | ||
@@ -133,2 +133,13 @@ /** | ||
var UNDEFINED = "undefined"; | ||
/** | ||
* Check whether the environment is window or node.js. | ||
* @memberof Consts | ||
* @example | ||
import {IS_WINDOW} from "@daybrush/utils"; | ||
console.log(IS_WINDOW); // false in node.js | ||
console.log(IS_WINDOW); // true in browser | ||
*/ | ||
var IS_WINDOW = typeof window !== UNDEFINED; | ||
var prefixes = ["webkit", "ms", "moz", "o"]; | ||
@@ -491,3 +502,3 @@ /** | ||
var firstTime = now(); | ||
var raf = typeof window !== UNDEFINED && (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame); | ||
var raf = IS_WINDOW && (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame); | ||
return raf ? raf.bind(window) : function (callback) { | ||
@@ -770,3 +781,3 @@ var currTime = now(); | ||
export { RGB, RGBA, HSL, HSLA, COLOR_MODELS, FUNCTION, PROPERTY, ARRAY, OBJECT, STRING, NUMBER, UNDEFINED, getCrossBrowserProperty, TRANSFORM, FILTER, ANIMATION, KEYFRAMES, cutHex, hexToRGBA, toFullHex, hslToRGBA, stringToRGBA, isUndefined, isObject, isArray, isString, isFunction, splitSpace, splitComma, splitBracket, splitUnit, camelize, decamelize, now, requestAnimationFrame, hasClass, addClass, removeClass, fromCSS }; | ||
export { RGB, RGBA, HSL, HSLA, COLOR_MODELS, FUNCTION, PROPERTY, ARRAY, OBJECT, STRING, NUMBER, UNDEFINED, IS_WINDOW, getCrossBrowserProperty, TRANSFORM, FILTER, ANIMATION, KEYFRAMES, cutHex, hexToRGBA, toFullHex, hslToRGBA, stringToRGBA, isUndefined, isObject, isArray, isString, isFunction, splitSpace, splitComma, splitBracket, splitUnit, camelize, decamelize, now, requestAnimationFrame, hasClass, addClass, removeClass, fromCSS }; | ||
//# sourceMappingURL=utils.esm.js.map |
@@ -6,3 +6,3 @@ /* | ||
repository: https://github.com/daybrush/utils | ||
@version 0.3.0 | ||
@version 0.4.0 | ||
*/ | ||
@@ -139,2 +139,13 @@ (function (global, factory) { | ||
var UNDEFINED = "undefined"; | ||
/** | ||
* Check whether the environment is window or node.js. | ||
* @memberof Consts | ||
* @example | ||
import {IS_WINDOW} from "@daybrush/utils"; | ||
console.log(IS_WINDOW); // false in node.js | ||
console.log(IS_WINDOW); // true in browser | ||
*/ | ||
var IS_WINDOW = typeof window !== UNDEFINED; | ||
var prefixes = ["webkit", "ms", "moz", "o"]; | ||
@@ -497,3 +508,3 @@ /** | ||
var firstTime = now(); | ||
var raf = typeof window !== UNDEFINED && (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame); | ||
var raf = IS_WINDOW && (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame); | ||
return raf ? raf.bind(window) : function (callback) { | ||
@@ -788,2 +799,3 @@ var currTime = now(); | ||
exports.UNDEFINED = UNDEFINED; | ||
exports.IS_WINDOW = IS_WINDOW; | ||
exports.getCrossBrowserProperty = getCrossBrowserProperty; | ||
@@ -790,0 +802,0 @@ exports.TRANSFORM = TRANSFORM; |
{ | ||
"name": "@daybrush/utils", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "utils for daybrush", | ||
@@ -5,0 +5,0 @@ "main": "dist/utils.js", |
@@ -22,2 +22,3 @@ # @daybrush/utils [![npm version](https://badge.fury.io/js/%40daybrush%2Futils.svg)](https://badge.fury.io/js/%40daybrush%2Futils) | ||
* ARRAY | ||
* IS_WINDOW | ||
@@ -24,0 +25,0 @@ ### [Cross Browser](http://daybrush.com/utils/release/latest/doc/CrossBrowser.html) |
@@ -120,2 +120,13 @@ /** | ||
/** | ||
* Check whether the environment is window or node.js. | ||
* @memberof Consts | ||
* @example | ||
import {IS_WINDOW} from "@daybrush/utils"; | ||
console.log(IS_WINDOW); // false in node.js | ||
console.log(IS_WINDOW); // true in browser | ||
*/ | ||
export const IS_WINDOW = typeof window !== UNDEFINED; | ||
const prefixes: string[] = ["webkit", "ms", "moz", "o"]; | ||
@@ -122,0 +133,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { ObjectInterface, UNDEFINED, STRING, OBJECT, FUNCTION } from "./consts"; | ||
import { ObjectInterface, UNDEFINED, STRING, OBJECT, FUNCTION, IS_WINDOW } from "./consts"; | ||
/** | ||
@@ -234,3 +234,3 @@ * @namespace | ||
const firstTime = now(); | ||
const raf = typeof window !== UNDEFINED && | ||
const raf = IS_WINDOW && | ||
(window.requestAnimationFrame || window.webkitRequestAnimationFrame || | ||
@@ -237,0 +237,0 @@ (window as any).mozRequestAnimationFrame); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
128051
2225
64