![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
A few very robust utilities.
Include all or be selective.
{ clone, merge, typeOf } = require 'lutils'
typeOf = require 'lutils/typeOf'
Clones an object or array as deep as depth.
Values which will still remain as references:
__proto__
(such as class
instances)depth
is reachedTo clone a function you should explicitly:
fn = oldFn.bind()
# or
fn = -> oldFn.apply this, arguments
merge fn, oldFn # Merge in any own properties of the function
Merge the second object into the first recursively until depth is reached for each property, replacing object1's values with those in object2.
types
is an array of types that, when matched on a value, will be iterated over and merged in. This means you can merge a function's properties or an array's properties recursively, thus preserving pointer references to the first object's instance.
fn1 = -> return 'fn1' + fn1.prop.b
fn1.prop = { a: 1 }
fn2 = -> return 'fn2' + fn2.prop.a
fn2.prop = { b: 2 }
obj1 = { a: { b: { fn: fn1 } } }
obj2 = { a: { b: { fn: fn2 } } }
merge obj1, obj2
# >> { a: { b: { fn: [Function] } } }
obj1.a.b.fn.prop
# >> { a: 1, b: 2 }
obj1.a.b.fn()
# 'fn1!2'
Whitelisted merge. Merges properties into object1 from object only if the property exists in object1
Blacklisted merge. Merges properties into object1 from object only if the property doesnt exist in object1
Returns the primitive type of a value as a lowercase string, very reliable.
To be used in combination with instanceof
and object.constructor.name
when necessary.
typeOf 'a string' # >> 'object'
typeOf { an: { object: null } } # >> 'object'
typeOf null # >> 'null'
typeOf 0 # >> 'number'
Also has helper properties which return a boolean.
typeOf.RegExp 'not regex' # false
typeOf.Object null # false
typeOf.Array [] # true
###
Avaliable properties (Also avaliable in lowercase):
typeOf.Undefined
typeOf.Boolean
typeOf.String
typeOf.Function
typeOf.Array
typeOf.Object
typeOf.Null
typeOf.Number
typeOf.Date
typeOf.RegExp
typeOf.NaN
###
FAQs
A few reliable utils.
The npm package lutils receives a total of 2,120 weekly downloads. As such, lutils popularity was classified as popular.
We found that lutils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.