@paroicms/anywhere-lib
Advanced tools
Comparing version 1.10.0 to 1.10.1
@@ -7,1 +7,2 @@ import type { Obj } from "../types/tiny-types"; | ||
export declare function messageOf(error: unknown): string; | ||
export declare function isObj(val: unknown): val is Obj; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.messageOf = exports.isDef = exports.formatObj = void 0; | ||
exports.isObj = exports.messageOf = exports.isDef = exports.formatObj = void 0; | ||
function formatObj(val, options = {}) { | ||
if (val === null || typeof val !== "object") { | ||
if (!isObj(val)) { | ||
throw new Error(`Invalid object value '${val === null ? "null" : typeof val}' for ${options.varName}`); | ||
@@ -40,2 +40,6 @@ } | ||
exports.messageOf = messageOf; | ||
function isObj(val) { | ||
return !!val && typeof val === "object" && !Array.isArray(val); | ||
} | ||
exports.isObj = isObj; | ||
//# sourceMappingURL=tiny.helpers.js.map |
@@ -7,1 +7,2 @@ import type { Obj } from "../types/tiny-types"; | ||
export declare function messageOf(error: unknown): string; | ||
export declare function isObj(val: unknown): val is Obj; |
export function formatObj(val, options = {}) { | ||
if (val === null || typeof val !== "object") { | ||
if (!isObj(val)) { | ||
throw new Error(`Invalid object value '${val === null ? "null" : typeof val}' for ${options.varName}`); | ||
@@ -34,2 +34,5 @@ } | ||
} | ||
export function isObj(val) { | ||
return !!val && typeof val === "object" && !Array.isArray(val); | ||
} | ||
//# sourceMappingURL=tiny.helpers.js.map |
{ | ||
"name": "@paroicms/anywhere-lib", | ||
"version": "1.10.0", | ||
"version": "1.10.1", | ||
"description": "Front lib for Paroi CMS.", | ||
@@ -5,0 +5,0 @@ "author": "Paroi Team", |
@@ -9,2 +9,2 @@ # @paroicms/anywhere-lib | ||
Released under the [MIT license](https://gitlab.com/paroi/opensource/paroicms/-/blob/main/LICENSE.md). | ||
Released under the [MIT license](https://gitlab.com/paroi/opensource/paroicms/-/blob/main/LICENSE.md). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
44462
736
10