DevimalPlanet / object-traversal

Flexible and performant utility for traversing javascript objects.
MIT License
22 stars 1 forks source link

inflight and glob deprecations #106

Open nicholaswmin opened 4 months ago

nicholaswmin commented 4 months ago

Hi bud,

Got a couple of deprecations, not sure where they are from. I can jump in and issue a PR if you're fine with it.

npm warn 
 inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.

npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported

Repro

Run:

npm ci 
kepelrs commented 4 months ago

Hey, thanks for reporting!

This shouldn't affect anyone using this package, as it is probably related to some devDependency and the package itself has no dependencies. But it should and will be addressed.

PRs are always welcome if you have the time!

nicholaswmin commented 1 month ago

Hi keipers, thanks for keeping this alive - sorry for the late response.

Indeed; nope not that big of a problem.

but what I'd do first and foremost is move the tests to native test runner and ditch any dependencies. I detest them in any shape and form.

If you're up for it, maybe I can push a small prototype with some parts migrated to it to a PR so you can decide if it makes sense?

I can take it up if you like it & i don't mind if you don't either.

Here's a recent example (I'll be matching the code-style of your test-suite ofc):


import test from 'node:test'
import utils from '../src/utils.js'

// - Polysyllabic test case fixes: https://github.com/nicholaswmin/fsm/issues/1

test('#utils String.onify(str)', async t => {
  const result = utils.String.onify('foo')

  await t.test('returns a result', t => {     
    t.assert.ok(result, `${result} is falsy`)
  })

  await t.test('returns a string', t => {     
    t.assert.strictEqual(typeof result, 'string')
  })

  await t.test('passing an all-lowercase string', async t => {     
    const result = utils.String.onify('foo')

    await t.test('appends "on"', async t => {     
      t.assert.ok(result.startsWith('on'), `got: ${result} instead`)

      await t.test('just once', t => {     
        t.assert.strictEqual(result.split('on').length, 2)
      })
    })

    await t.test('uppercases 1st char', async t => {     
      t.assert.strictEqual(result[2], 'F')

      await t.test('remainder is unchanged', t => {     
        t.assert.strictEqual(result.split('onF').slice(1).join(''), 'oo')
      })
    })
  })
})

PRs are always welcome if you have the time!

Yup sometimes i do :)