Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@okam/core-lib

Package Overview
Dependencies
Maintainers
0
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@okam/core-lib - npm Package Compare versions

Comparing version 1.13.4 to 1.14.0

utils/string-transform.d.ts

1

index.d.ts

@@ -10,1 +10,2 @@ export { Asserts } from './utils/asserts';

export { default as checkObjectProperty } from './utils/object-property';
export { capitalizeFirstLetter } from './utils/string-transform';

2

index.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),b=e=>{if(typeof e!="string"||!/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(e))return!1;try{return new Date(e).toISOString()===e}catch{return!1}},c=(e,t=!0)=>typeof e=="string"&&(t?e.trim():e).length>0,d=e=>typeof e=="object"&&e!==null&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype,a=e=>typeof e=="number"&&Number.isSafeInteger(e),p=e=>typeof e=="number"&&!Number.isNaN(e)?!0:c(e)?!Number.isNaN(Number.parseInt(e,10)||Number.isNaN(Number.parseFloat(e))):!1,g=e=>{const t=typeof e=="string"&&/^-?\d+$/.test(e)?Number.parseInt(e,10):e;return a(t)},y=e=>a(e)&&e<600&&e>=100;class o{static isPresent(t,r){if(t==null)throw o.createException(r,"Value is null or undefined.")}static safeInteger(t,r){if(typeof t!="number"||!Number.isSafeInteger(t))throw o.createException(r,"Value is not a safe integer")}static nonEmptyString(t,r,n){if(!c(t,n??!0))throw o.createException(r)}static never(t,r){throw new Error(r??"Unexpected value")}static createException(t,r){throw typeof t=="string"||t===void 0?new Error(t??r??"Assertion did not pass."):t()}}function h(e,t){if([e,t].forEach((r,n)=>{if(!Number.isSafeInteger(r))throw new Error(`${n===0?"min":"max"} is not a valid integer`)}),t<e)throw new Error("Min cannot be greater than max");return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}class N{static getRandom(t){return t[h(0,t.length-1)]}static removeItem(t,r){const n=t.indexOf(r);return n>-1&&t.splice(n,1),t}}function m(){const e=i.createContext(void 0);function t(){const r=i.useContext(e);if(r===void 0)throw new Error("useCtx must be inside a Provider");return r}return[t,e.Provider]}function x(){const e=i.createContext(void 0);function t(){const r=i.useContext(e);return r===void 0?{}:r}return[t,e.Provider]}function O(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function f(e,t,r){const n=Object.keys(e);let s;s||(s=r);for(const u of n){const l=e[u];if(O(l)&&(s||(s=f(l,t,s))),u===t)return e[t]}return s}const w=(e,t)=>{const r=e[t];return r!=null&&typeof r=="object"&&Object.prototype.hasOwnProperty.call(e,t)?r:null},I=e=>`I'm the @okam/shared-ui component telling ${e} !`;exports.ArrayUtils=N;exports.Asserts=o;exports.checkObjectProperty=w;exports.createCtx=m;exports.createCtxNullable=x;exports.getNestedObjectValueOfKey=f;exports.isHttpStatusCode=y;exports.isIsoDateString=b;exports.isNonEmptyString=c;exports.isParsableNumeric=p;exports.isParsableSafeInteger=g;exports.isPlainObject=d;exports.isSafeInteger=a;exports.sayHello=I;
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),p=e=>{if(typeof e!="string"||!/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(e))return!1;try{return new Date(e).toISOString()===e}catch{return!1}},c=(e,t=!0)=>typeof e=="string"&&(t?e.trim():e).length>0,b=e=>typeof e=="object"&&e!==null&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype,a=e=>typeof e=="number"&&Number.isSafeInteger(e),d=e=>typeof e=="number"&&!Number.isNaN(e)?!0:c(e)?!Number.isNaN(Number.parseInt(e,10)||Number.isNaN(Number.parseFloat(e))):!1,g=e=>{const t=typeof e=="string"&&/^-?\d+$/.test(e)?Number.parseInt(e,10):e;return a(t)},y=e=>a(e)&&e<600&&e>=100;class o{static isPresent(t,r){if(t==null)throw o.createException(r,"Value is null or undefined.")}static safeInteger(t,r){if(typeof t!="number"||!Number.isSafeInteger(t))throw o.createException(r,"Value is not a safe integer")}static nonEmptyString(t,r,n){if(!c(t,n??!0))throw o.createException(r)}static never(t,r){throw new Error(r??"Unexpected value")}static createException(t,r){throw typeof t=="string"||t===void 0?new Error(t??r??"Assertion did not pass."):t()}}function h(e,t){if([e,t].forEach((r,n)=>{if(!Number.isSafeInteger(r))throw new Error(`${n===0?"min":"max"} is not a valid integer`)}),t<e)throw new Error("Min cannot be greater than max");return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}class N{static getRandom(t){return t[h(0,t.length-1)]}static removeItem(t,r){const n=t.indexOf(r);return n>-1&&t.splice(n,1),t}}function m(){const e=s.createContext(void 0);function t(){const r=s.useContext(e);if(r===void 0)throw new Error("useCtx must be inside a Provider");return r}return[t,e.Provider]}function x(){const e=s.createContext(void 0);function t(){const r=s.useContext(e);return r===void 0?{}:r}return[t,e.Provider]}function O(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function f(e,t,r){const n=Object.keys(e);let i;i||(i=r);for(const u of n){const l=e[u];if(O(l)&&(i||(i=f(l,t,i))),u===t)return e[t]}return i}const w=(e,t)=>{const r=e[t];return r!=null&&typeof r=="object"&&Object.prototype.hasOwnProperty.call(e,t)?r:null};function I(e){return e.charAt(0).toUpperCase()+e.slice(1)}const P=e=>`I'm the @okam/shared-ui component telling ${e} !`;exports.ArrayUtils=N;exports.Asserts=o;exports.capitalizeFirstLetter=I;exports.checkObjectProperty=w;exports.createCtx=m;exports.createCtxNullable=x;exports.getNestedObjectValueOfKey=f;exports.isHttpStatusCode=y;exports.isIsoDateString=p;exports.isNonEmptyString=c;exports.isParsableNumeric=d;exports.isParsableSafeInteger=g;exports.isPlainObject=b;exports.isSafeInteger=a;exports.sayHello=P;
{
"name": "@okam/core-lib",
"version": "1.13.4",
"version": "1.14.0",
"main": "./index.js",

@@ -5,0 +5,0 @@ "types": "./index.d.ts",

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