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

font-finder

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

font-finder - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

7

CHANGELOG.md

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

# [1.1.0](https://github.com/princjef/font-finder/compare/v1.0.5...v1.1.0) (2020-11-26)
### Features
* add onFontError to list options ([#8](https://github.com/princjef/font-finder/issues/8)) ([2ec412d](https://github.com/princjef/font-finder/commit/2ec412d))
## [1.0.5](https://github.com/princjef/font-finder/compare/v1.0.4...v1.0.5) (2020-11-26)

@@ -2,0 +9,0 @@

4

dist/index.d.ts

@@ -53,2 +53,6 @@ import * as extract from './extract';

language?: string;
/**
* Function to call on font loading error. Default: null
*/
onFontError?: ((path: string, err: Error) => void) | null;
}

@@ -55,0 +59,0 @@ /**

7

dist/index.js

@@ -24,3 +24,3 @@ "use strict";

async function list(options) {
const opts = Object.assign({ concurrency: 4, language: 'en' }, options);
const opts = Object.assign({ concurrency: 4, language: 'en', onFontError: null }, options);
// TODO: support woff, woff2, ttc

@@ -35,5 +35,4 @@ const files = await get_system_fonts_1.default({ extensions: ['ttf', 'otf'] });

catch (e) {
// Don't swallow language errors
if (['TypeError', 'SyntaxError', 'ReferenceError', 'RangeError', 'AssertionError'].includes(e.name)) {
throw e;
if (opts.onFontError) {
opts.onFontError(file, e);
}

@@ -40,0 +39,0 @@ }

{
"name": "font-finder",
"version": "1.0.5",
"version": "1.1.0",
"description": "Quickly find system font names and metadata without native dependencies",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/princjef/font-finder#readme",

@@ -65,2 +65,7 @@ import getSystemFonts from 'get-system-fonts';

language?: string;
/**
* Function to call on font loading error. Default: null
*/
onFontError?: ((path: string, err: Error) => void) | null;
}

@@ -87,2 +92,3 @@

language: 'en',
onFontError: null,
...options

@@ -101,5 +107,4 @@ };

} catch (e) {
// Don't swallow language errors
if (['TypeError', 'SyntaxError', 'ReferenceError', 'RangeError', 'AssertionError'].includes(e.name)) {
throw e;
if (opts.onFontError) {
opts.onFontError(file, e);
}

@@ -106,0 +111,0 @@ }

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