1.1.1 • Published 3 years ago

@lucidcreative/disguise-asset v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

disguise-asset

a simple library for converting a filepath to a disguise asset object.

type-safety is included out of the box.

Disguise asset object?

Disguise (aka d3) uses a set of content management rules to manage version replacements and other magic under the hood of their media server. This library attempts to recreate the logic they use to process a file based on it's file name and path. The resulting object looks like:

interface DisguiseAsset {
	stem: string
	extension: string
	version?: string
	proxyLevel?: number
	frameStart?: number
	originalFilename: string
}

you might notice that version is a string, when all other tags are numbers, and that's because date+letters is also a valid version tag. Versions are always sorted alphabetically.


Benchmark Summary:

CountTime
1310112 μs
1000.762929 ms
10006.511104 ms
1000000171.870434 ms
  • μs = nanoseconds
  • test hardware:
    • Darwin x64
    • Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
    • 16.0 GB RAM
  • all tests done on randomized data, YMMV

brought to you by

Lucid