You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
1000 B

// Minimal util module implementation for browser
const util = {
inherits: () => {},
format: (...args) => args.join(" "),
inspect: (obj) => JSON.stringify(obj),
isArray: Array.isArray,
isBoolean: (val) => typeof val === "boolean",
isNull: (val) => val === null,
isNullOrUndefined: (val) => val == null,
isNumber: (val) => typeof val === "number",
isString: (val) => typeof val === "string",
isSymbol: (val) => typeof val === "symbol",
isUndefined: (val) => val === undefined,
isRegExp: (val) => val instanceof RegExp,
isDate: (val) => val instanceof Date,
isError: (val) => val instanceof Error,
isFunction: (val) => typeof val === "function",
isObject: (val) => val !== null && typeof val === "object",
isPrimitive: (val) => {
return (
val === null ||
typeof val === "boolean" ||
typeof val === "number" ||
typeof val === "string" ||
typeof val === "symbol" ||
typeof val === "undefined"
);
},
};
export default util;